/*
 * Create:      柿子
 * CreateDate:  2022/11/23
 * Describe：   视光二期优化制单公共组件 - 
 * 入库质检(IMWarehousingInspect) / 入库复核(IMWarehousingReview) / 转移出库制单(IMTransferIssueVoucher) / 退货申请^退货申请接收^退货单处理(IMReturnVoucher) / 科室退库申请^科室退库申请接收(IMStockReturnApply)
 * 采购计划^集团采购中心(IMProcurementPlan) / 采购收货(IMPurchaseReceipt) / 集团采购计划(IMGroupProcurementPlan) / 集团采购审核(IMGroupPurchasePlanReview)
 * */
import React, { Component } from 'react';
import { Card, Radio, Button, Popconfirm, Icon, Tooltip, Spin, Steps, Divider, Select, Input, message, Modal, Checkbox, Tag, Dropdown, Menu, Upload } from 'antd';
import { Util, dayFormat, timeFormat } from 'tools';
import { handleExcel } from 'tools/handleExcel';
import { $loopPrint } from 'pages/lodop/Common/Print.js';
import store from 'store';
import moment from 'moment';
import PublicTableinLineEditing from 'pages/common/PublicTableinLineEditing';
import DynamicRenderingForm from 'pages/common/DynamicRenderingForm';
import PubilcTablePagination from 'pages/common/PubilcTablePagination.jsx';
import iconListvisits from 'assets/images/icon_listvisits.png';
import iconMessages from 'assets/images/icon_messages.png';
import ReturnOrder from 'pages/optometry/glassesManagement/component/ReturnOrder';
import MatchingDetails from 'pages/optometry/glassesManagement/component/MatchingDetails';
import OrderOfGlassesModal from 'pages/optometry/storageRoom/component/OrderOfGlassesModal';
import '../workstation/style/index.less';
import './style/index.less';
const { Step } = Steps;
const { TextArea } = Input;

class InventoryManagement extends Component {
  constructor(props) {
    super(props);
    let userData = React.$getSessionData();
    this.state = {
      categoryData: {},
      userData,
      selectData: {},
      statusRadioData: [],
      statusRadioVal: '',
      queryFormData: [],
      columns: [],
      totalWidth: 550,
      tableData: [],
      page: 1,
      pageSize: 20,
      total: 0,
      loading: false,
      rowID: '',
      detailDeleteFlag: true, // 明细删除状态
      rowData: {},
      queryHeight: 125, // 查询栏高度
      queryWidth: 762,
      spinLoading: true,
      stepsData: [],
      currentStep: undefined,
      detailColumns: [],
      detailTotalWidth: 0,
      baseFormData: [],
      detailTableData: [],
      detailRowID: '',
      returnFlag: '', // 退回标志，用于区分订单整单退回还是明细单条退回
      selectedRowKeys: [],
      scanningCode: undefined,
      currentInspectType: undefined,
      orderModalType: '', // 订单类型
      assistModalTitle: '', // 辅助制单弹窗描述
      frLocID: '', // 供给科室
      sumRp: 0, // 进价总金额
      sumSp: 0, // 售价总金额
      detailLoading: false, // 明细loading
      defaultDate: 0,
      vendorID: '', // 供应商
      saveBtnLoading: false,
      auditBtnLoading: false,
      exportLoading: false,
      ERPExportLoading: false,
      detailExportBtnLoading: false, // 明细导出
      recordSaveLoading: false,
      statusFormItem: {}, // 单据状态铺开展示对应的formItem
      printBtnLoading: false,
      leftCardFlag: false,
      detailSelectedRowKeys: [], // 明细列选择
      GSPExportLoading: false,
      detailExportGSPBtnLoading: false, // 明细GSP打印
    };
    this.queryRef = React.createRef();
    this.scanningRef = React.createRef();
  }

  componentDidMount() {
    let newCategory;
    if ('paras' in this.props && this.props.paras && this.props.paras.params) { // 侧菜单获取类别参数
      newCategory = this.props.paras.params;
    } else {
      if ('location' in this.props && this.props.location.state && this.props.location.state.params) { // 头菜单获取类别参数
        newCategory = this.props.location.state.params;
        React.$setSessionData('InventoryManagement', newCategory, false);
      } else { // 头菜单刷新界面时获取类别
        newCategory = React.$getSessionData('InventoryManagement', false);
      }
    }
    let categoryData = Util.getObjByUrlStr(newCategory);
    console.log("InventoryManagement", categoryData);
    this.setState({ categoryData, orderModalType: categoryData?.orderModalType || '', assistModalTitle: categoryData?.assistModalTitle || '从订单选择' }, () => {
      this.getSelectData();
    });
  }

  componentWillUnmount() {
    // 组件销毁前将静止让setState修改state的状态
    this.setState = (state, callback) => { return; }
  }

  // 获取下拉框数据
  getSelectData = async (fn) => {
    try {
      let { userData, categoryData, currentInspectType } = this.state;
      if (!(categoryData && categoryData.selectCode)) {
        this.getTableColumns('Y');
        this.getDetailColumns();
      } else {
        let data = {
          params: [{
            hospID: userData?.hospID || '',
            groupType: categoryData?.groupType || undefined, //  H 医院   G集团
            componentName: categoryData?.componentName || undefined, // 组件名
            inspectType: currentInspectType
          }]
        }
        let res = await React.$asyncPost(this, categoryData.selectCode, data);
        let selectData = res?.result || {};
        let componentNameArr = ['IMProcurementPlan', 'IMPurchasePlanReview', 'IMGroupProcurementPlan', 'IMGroupPurchasePlanReview', 'IMGroupReturnOrderConfirmation', 'IMReturnVoucher'];
        if ((componentNameArr.indexOf(categoryData?.componentName)) > -1 || categoryData?.supplierValueDetailFlag === 'Y') {
          selectData.vendor = [];
        }
        if (!fn) {
          let statusRadioData = selectData?.status || [];
          let inspectTypeData = selectData?.inspectType || [];
          let statusDefaultVal = statusRadioData && statusRadioData.filter(item => (item.defaultFlag === 'Y' || item.default === 'Y')); // 默认状态值
          let inspectTypeVal = inspectTypeData && inspectTypeData.filter(item => (item.defaultFlag === 'Y' || item.default === 'Y')); // 默认状态值
          this.setState({
            statusRadioData,
            stepsData: selectData?.title || [],
            statusRadioVal: statusDefaultVal && statusDefaultVal.length > 0 ? statusDefaultVal[0].id : '',
            currentInspectType: inspectTypeVal && inspectTypeVal.length > 0 ? inspectTypeVal[0].id : '',
          });
        }
        this.setState({ selectData }, () => {
          if (fn) { // 重新调用初始化接口并打开辅助制单窗口
            fn();
          } else {
            this.getTableColumns('Y');
            this.getDetailColumns();
            this.getCurrentStep();
          }
        });
      }
    } catch (error) {
      this.setState({ selectData: {}, statusRadioData: [], currentStep: undefined }, () => {
        this.getTableColumns('Y');
        this.getDetailColumns();
      });
    }
  }

  // 获取当前步骤节点
  getCurrentStep = () => {
    let { stepsData } = this.state;
    if (stepsData && stepsData.length > 0) {
      let execStopsData = stepsData && stepsData.filter(item => item.execStatus === 'Y');
      this.setState({ currentStep: execStopsData && execStopsData.length > 0 ? execStopsData.length - 1 : 0 });
    }
  }

  // 获取列表表头数据
  getTableColumns = async (isQuery) => {
    try {
      const { selectData, categoryData } = this.state;
      if (!(categoryData && categoryData.componentName)) {
        message.error('主列表数据还未配置呢，快去配置先！');
        this.setState({ spinLoading: false });
        return;
      }
      let data = {
        params: [{
          compontName: categoryData.componentName,
          type: 'C',
        }]
      }
      let res = await React.$asyncPost(this, '01040073', data);
      let columns = res.result && res.result.C && res.result.C.length > 0 ? res.result.C : [];
      if (columns && columns.length > 0) {
        columns = columns.map(item => {
          let dataIndex = item?.dataIndex || '';
          return {
            ...item,
            render: (text, record, index) => {
              if (item?.linkMethod === 'Input') {
                return (
                  <Input
                    allowClear
                    placeholder="请输入"
                    style={{ width: '96%' }}
                    value={record && dataIndex in record ? record[dataIndex] : undefined}
                    onChange={(e) => this.handleInputChange(index, e.target.value, item, record)}
                    onBlur={() => this.handleLogisticsSave(record)}
                    onClick={(e) => React.$stopPropagation(e)}
                  />
                )
              } else if (item?.linkMethod === 'Select') {
                let selectAttr = { // 下拉框属性
                  allowClear: true,
                  showSearch: true,
                  style: { width: '96%' },
                  optionFilterProp: "seachprop",
                  placeholder: '请选择',
                  value: record && dataIndex in record ? record[dataIndex] : undefined,
                  onChange: (e) => this.handleInputChange(index, e, item, record),
                  onClick: (e) => React.$stopPropagation(e)
                };
                let selectOption = item && item.linkService && selectData[item.linkService] && Array.isArray(selectData[item.linkService]) ? React.$SelectOptions(selectData[item.linkService]) : '';
                return (
                  <Select {...selectAttr}>
                    {selectOption}
                  </Select>
                )
              } else {
                return (
                  <Tooltip title={text}>
                    <span
                      className="ellipsis"
                      style={{ width: '100%', display: 'block', color: item.dataIndex === 'statusDesc' && record.statusDesc.indexOf('拒绝') > -1 ? '#f04134' : '' }}
                    >
                      {text}
                    </span>
                  </Tooltip>
                );
              }
            },
          }
        })
        this.setState({
          columns,
          totalWidth: res.totalWidth
        })
      }
      // 表单操作数据
      let queryFormData = res.result?.formData || [];
      let defaultDate = 0;
      let statusFormItem = {};
      if (queryFormData && queryFormData.length > 0) {
        for (let i = 0; i < queryFormData.length; i++) {
          if (queryFormData[i].typeCode === 'RangePicker') {
            defaultDate = (queryFormData[i]?.default || 0);
          }
          if (queryFormData[i].dataIndex === 'hospID') { // 申请机构，如果采购计划菜单给医院挂的话不能修改申请机构，挂给集团的话可以修改
            queryFormData[i].disabled = categoryData?.groupType === 'H' ? 'Y' : (queryFormData[i]?.disabled || 'N'); // 其他的走维护
          }
          if (queryFormData[i].typeCode === 'Input' || queryFormData[i].typeCode === 'InputNumber' || queryFormData[i].typeCode === 'TextArea') {
            queryFormData[i].onPressEnter = this.handleQuery;
          }
        }
        if (categoryData?.stateSpreadingFlag === 'Y') { // 配置单据状态是否铺开显示，铺开显示则需要维护对应单据状态的dataIndex，因为铺开展示得显示对应状态的数量，得联合后台一起
          let stateSpreadingIndex = categoryData?.stateSpreadingIndex || 'status';
          let statusFormData = queryFormData && queryFormData.filter(item => item.dataIndex === stateSpreadingIndex);
          statusFormItem = statusFormData && statusFormData.length > 0 ? statusFormData[0] : {};
          queryFormData = queryFormData && queryFormData.filter(item => item.dataIndex !== stateSpreadingIndex);
        }
      }
      // 查询
      queryFormData.push({
        col: 3,
        typeCode: 'Button',
        type: 'primary',
        title: '查询',
        marginBottom: 12,
        onClick: this.handleQuery
      });
      // 导出
      if (categoryData?.mainListExportCode) {
        queryFormData.push({
          col: 3,
          ghost: true,
          typeCode: 'Button',
          type: 'primary',
          title: categoryData?.mainListExportBtnTitle || '导出',
          marginBottom: 12,
          onClick: this.handleExport
        })
      }
      // ERP导出
      if (categoryData?.mainListERPExportCode) {
        queryFormData.push({
          col: 4,
          ghost: true,
          typeCode: 'Button',
          type: 'primary',
          title: categoryData?.mainListERPExportBtnTitle || '导出ERP明细',
          marginBottom: 12,
          onClick: this.handleERPExport
        })
      }
      // GSP导出
      if (categoryData?.mainListGSPExportCode) {
        queryFormData.push({
          col: 4,
          ghost: true,
          typeCode: 'Button',
          type: 'primary',
          title: categoryData?.mainListGSPExportBtnTitle || '导出GSP明细',
          marginBottom: 12,
          onClick: this.handleGSPExport
        })
      }
      this.setState({ queryFormData, defaultDate, statusFormItem }, () => {
        this.setState({ queryHeight: this.queryRef?.current?.clientHeight || 125, queryWidth: this.queryRef?.current?.clientWidth || 762 });
      });
    } catch (error) {
      console.log(error);
    }
    if (isQuery === 'Y') { // 自动查询标志
      this.setState({ spinLoading: false }, () => {
        setTimeout(() => {
          this.getTableData();
        }, 300)
      });
    }
  }

  // 保存行数据
  handleLogisticsSave = async record => {
    try {
      const { categoryData } = this.state;
      if (!(categoryData && categoryData.recordSaveCode)) {
        message.error('行数据保存接口还未配置呢，快去配置先！');
        return;
      };
      this.setState({ recordSaveLoading: true });
      let data = {
        params: [{
          ...record
        }]
      }
      let res = await React.$asyncPost(this, categoryData.recordSaveCode, data);
      message.success(res?.errorMessage || '保存成功');
      this.setState({ recordSaveLoading: false }, () => {
        this.getTableData();
      });
    } catch (error) {
      console.log('error', error);
      this.setState({ recordSaveLoading: false });
    }
  }

  // 修改入参
  handleInputChange = (index, val, item, record) => {
    let dataIndex = item?.dataIndex || '';
    let inputType = item?.linkMethod || 'Input';
    if (inputType === 'DatePicker' || item.inputType === 'Date') { // 日期
      record.autoOpenFlag = 'Y'; // 新增时不自动打开日期选择框，选择过一次之后左右键切回来自动打开
      val = val ? moment(val).format(item?.format || dayFormat) : undefined;
    } else if (inputType === 'TimePicker' || inputType === 'Time') { // 时间
      val = val ? moment(val).format(item?.format || timeFormat) : undefined;
    }
    record[dataIndex] = val;
    this.setState({}, () => {
      inputType === 'Select' && this.handleLogisticsSave(record);
    });
  }

  // 获取明细表头数据
  getDetailColumns = async () => {
    try {
      const { categoryData, selectData } = this.state;
      let compontName = categoryData?.componentName || '';
      let detailComponentName = categoryData?.childComponentName || (compontName ? (compontName + 'Detail') : '');
      if (!detailComponentName) {
        message.error('明细列表数据还未配置呢，快去配置先！');
        return;
      }
      let data = {
        params: [{
          compontName: detailComponentName,
          type: 'C',
        }]
      }
      let res = await React.$asyncPost(this, '01040073', data);
      let detailColumns = res.result?.C || [];
      // 表单操作数据
      let baseFormData = res.result?.formData || [];
      for (var i = 0; i < baseFormData.length; i++) {
        baseFormData[i].defaultDisabled = baseFormData[i]?.disabled || 'N';
        if (baseFormData[i].dataIndex === 'inspectType') { // 质检类型
          baseFormData[i].callBackResult = 'Fn';
          baseFormData[i].changeCallBack = this.handleInspectTypeChange;
        }
      }
      if (categoryData?.detailInlineEditingFlag === 'Y') { // 行内编辑
        for (let i = 0; i < detailColumns.length; i++) {
          let inputType = detailColumns[i]?.linkMethod || '';
          let linkService = detailColumns[i]?.linkService || '';

          detailColumns[i].isRender = 'N'; // 避免重新渲染
          detailColumns[i].autoOpenFlag = 'N';
          detailColumns[i].popupContainer = 'N';
          detailColumns[i].inputType = inputType;
          detailColumns[i].required = Util.getValueByUrlStr(linkService, 'required'); // 必填标志
          detailColumns[i].defaultValue = Util.getValueByUrlStr(linkService, 'defaultValue'); // 默认值
          detailColumns[i].copyClearFlag = Util.getValueByUrlStr(linkService, 'copyClearFlag'); // 复制时清除标志
          detailColumns[i].copyDisabledFlag = Util.getValueByUrlStr(linkService, 'copyDisabledFlag'); // 复制时禁用标志
          if (inputType === 'Select' || inputType === 'SelectMultiple' || inputType === 'SelectTags') {
            let detailItemSource = linkService && linkService.indexOf('^') > -1 ? linkService.split('^')[0] : '';
            let detailItemDataIndex = linkService && linkService.indexOf('^') > -1 ? linkService.split('^')[1] : '';
            detailColumns[i].detailItemSource = detailItemSource; // 下拉框取值来源，record为行数据，表示该下拉框的数据直接取行数据中的
            detailColumns[i].detailItemDataIndex = detailItemDataIndex; // 下拉框取值来源，下拉框对应取行数据中对应的字段
            detailColumns[i].detailItem = detailItemSource ? [] : selectData[linkService];
          }
          if (inputType === 'InputTable') { // 下拉列表
            detailColumns[i].linkCode = linkService && linkService.indexOf('^') > -1 ? linkService.split('^')[0] : linkService;
            detailColumns[i].componentName = linkService && linkService.indexOf('^') > -1 ? linkService.split('^')[1] : (categoryData?.modalTableComponentName || '');
          }
          let computeFlag = Util.getValueByUrlStr(linkService, 'computeFlag'); // 计算标志：修改数量【数量 * 进价 = 进价金额 | 数量 * 售价 = 售价金额】
          if (computeFlag) { // 修改数量计算进价、售价总金额
            let spCountDataIndex = categoryData?.spCountDataIndex || 'sp';
            let rpCountDataIndex = categoryData?.rpCountDataIndex || 'rp';
            let qtyCountDataIndex = categoryData?.qtyCountDataIndex || 'qty';
            let detailRecordRpAmt = categoryData?.detailRecordRpAmt || 'rpAmt';
            let detailRecordSpAmt = categoryData?.detailRecordSpAmt || 'spAmt';
            detailColumns[i].computeFlag = computeFlag;
            detailColumns[i].spDataIndex = spCountDataIndex;
            detailColumns[i].rpDataIndex = rpCountDataIndex;
            detailColumns[i].rpAmtDataIndex = detailRecordRpAmt;
            detailColumns[i].spAmtDataIndex = detailRecordSpAmt;
            detailColumns[i].qtyDataIndex = qtyCountDataIndex;
          }
        }
      }
      this.setState({
        baseFormData,
        detailColumns,
        detailTotalWidth: res.totalWidth
      }, () => {
        this.handleFilterDetailColumns('Y');
      });
    } catch (error) {
      console.log(error)
    }
  }

  // 处理明细表单数据
  handleFilterDetailColumns = (isRender) => {
    let { categoryData, detailColumns, selectData, rowID, rowData } = this.state;
    if (categoryData?.detailInlineEditingFlag === 'Y') { // 行内编辑
      isRender === 'Y' && this.lineEditableRef && this.lineEditableRef.setTableColumns(detailColumns);
    } else {
      if (detailColumns && detailColumns.length > 0) {
        detailColumns = detailColumns.map(item => {
          let dataIndexCode = item.dataIndex && item.dataIndex.indexOf('ID') > -1 ? item.dataIndex.replace('ID', 'Desc') : (item.dataIndex.indexOf('Desc') > -1 ? item.dataIndex : item.dataIndex + 'Desc');
          return {
            ...item,
            render: (text, record, index) => {
              if (item.dataIndex === 'qualityResults' || item.dataIndex === 'receiptStatus') { // 质检结果 // 收货状态
                if (!rowID || (rowData?.statusCode === (categoryData?.preAuditStatusCode || '10') || (rowData?.statusCode === '40' && categoryData.groupType !== 'G'))) {
                  return (
                    <Select
                      allowClear
                      showSearch
                      style={{ width: '90%' }}
                      placeholder={item.dataIndex === 'qualityResults' ? '待质检' : '待收货'}
                      optionFilterProp="search"
                      className={(record?.qualityResults === 'N' || record?.receiptStatus === 'T') ? 'common-record-delete-span' : ''}
                      value={record[item.dataIndex] || undefined}
                      onChange={(e) => this.handleDetailInputChange(e, index, item.dataIndex)}
                    >
                      {React.$SelectOptions(selectData[item.dataIndex] || [])}
                    </Select>
                  );
                } else {
                  return (
                    <Tooltip title={record[dataIndexCode]}>
                      <span className="ellipsis" style={{ width: '100%', display: 'block' }}>{record[dataIndexCode]}</span>
                    </Tooltip>
                  )
                }
              } else if (item.dataIndex === 'reasonID' || item.dataIndex === 'reasonDesc') { // 不合格原因
                // 【质量检查需选择原因 - 走的detailReasonModifyFlag维护】【采购收货 -> reasonFlag行数据原因标志为N可修改原因和需换货标志】
                if ((record?.reasonFlag === 'N' || categoryData?.detailReasonModifyFlag === 'Y') && !rowID || (rowData?.statusCode === (categoryData?.preAuditStatusCode || '10') || (rowData?.statusCode === '40' && categoryData.groupType !== 'G'))) {
                  if (item?.linkMethod === 'Input') {
                    return (
                      <Input
                        allowClear
                        style={{ width: '90%' }}
                        placeholder="请输入"
                        value={record[item.dataIndex] || undefined}
                        onChange={(e) => this.handleDetailInputChange(e.target.value, index, item.dataIndex)}
                      />
                    );
                  } else if (item?.linkMethod === 'TextArea') {
                    return (
                      <TextArea
                        allowClear
                        style={{ width: '90%' }}
                        placeholder="请输入"
                        value={record[item.dataIndex] || undefined}
                        onChange={(e) => this.handleDetailInputChange(e.target.value, index, item.dataIndex)}
                      />
                    );
                  } else {
                    return (
                      <Select
                        allowClear
                        showSearch
                        style={{ width: '90%' }}
                        placeholder="请选择"
                        optionFilterProp="search"
                        value={record?.reasonID || undefined}
                        onChange={(e) => this.handleDetailInputChange(e, index, 'reasonID')}
                      >
                        {React.$SelectOptions(selectData?.reason || [])}
                      </Select>
                    );
                  }
                } else {
                  return (
                    <Tooltip title={record[dataIndexCode]}>
                      <span className="ellipsis" style={{ width: '100%', display: 'block' }}>{record[dataIndexCode]}</span>
                    </Tooltip>
                  )
                }
              } else if (item.dataIndex === 'exchange') { // 需换货标志
                if (record?.reasonFlag === 'N' && (!rowID || (rowData?.statusCode === (categoryData?.preAuditStatusCode || '10') || (rowData?.statusCode === '40' && categoryData.groupType !== 'G')))) {
                  return (
                    <Checkbox checked={record[item.dataIndex] === 'Y' ? true : false} onChange={(e) => this.handleDxchange(e.target.checked ? 'Y' : 'N', item.dataIndex, record)} />
                  );
                } else {
                  return (
                    <Tooltip title={record[item.dataIndex] === 'Y' ? '是' : '否'}>
                      <span className="ellipsis" style={{ width: '100%', display: 'block' }}>{record[item.dataIndex] === 'Y' ? '是' : '否'}</span>
                    </Tooltip>
                  )
                }
              } else if (item.dataIndex === 'reqNo') { // 订单号
                return (
                  <Tooltip title={text}>
                    <span
                      className={record.errorReqNo === 'Y' ? 'common-record-delete-span' : 'span' + ' ellipsis'}
                      onClick={(e) => this.handleViewDetails(record, e)}
                      style={{ width: '100%', display: 'block' }}
                    >
                      {text}
                    </span>
                  </Tooltip>
                );
              } else if (item.dataIndex === 'urgentSign' && (text === '一级加急' || text === '二级加急')) { // 加急标志
                return (
                  <Tag style={{ fontWeight: 'normal' }} color={text === '一级加急' ? '#FF3D00' : (text === '二级加急' ? '#FA8C17' : '')}>{text}</Tag>
                );
              } else {
                return (
                  <Tooltip title={text}>
                    <span className="ellipsis" style={{ width: '100%', display: 'block' }}>{text}</span>
                  </Tooltip>
                );
              }
            },
          }
        })
        // 采购计划单独处理，采购计划是根据状态展示的，医院和集团操作的都不一样
        if (categoryData?.componentName === 'IMProcurementPlan' || categoryData?.componentName === 'IMPurchasePlanReview') {
          let isOperation = rowData.statusCode === '20' && categoryData && categoryData.groupType === 'G' ? true : false;
          let isAddRemark = true;
          for (var i = 0; i < detailColumns.length; i++) {
            if (detailColumns[i].dataIndex === 'reasonID') {
              isAddRemark = false;
              break;
            }
          }
          if (rowData && rowData.statusCode === '20' && !isAddRemark) return; // 待审核状态不能重复添加
          if (rowData && (isOperation || rowData.statusCode === '40')) { // 添加备注列，暂时只有采购计划需要
            // console.log("触发了", isOperation)
            let remarkObj = {
              key: 'remark',
              title: '备注',
              dataIndex: 'reasonID', // 状态20且groupType为集团的话可选择备注
              align: 'center',
              width: 160,
              render: (text, record, index) => {
                if (isOperation) {
                  return (
                    <Select
                      allowClear
                      showSearch
                      style={{ width: '90%' }}
                      placeholder="请选择"
                      optionFilterProp="search"
                      value={record?.reasonID || undefined}
                      onChange={(e) => this.handleDetailInputChange(e, index, 'reasonID')}
                    >
                      {React.$SelectOptions(selectData?.reason || [])}
                    </Select>
                  )
                } else {
                  return (
                    <Tooltip title={record.reasonDesc}>
                      <span className='ellipsis' style={{ width: '100%', display: 'block', color: '#f04134' }}>{record.reasonDesc}</span>
                    </Tooltip>
                  )
                }
              }
            };
            if (isAddRemark) { // 是否添加备注列 - 添加过则不需要重复添加
              detailColumns = [remarkObj, ...detailColumns];
            }
            // console.log("detailColumns", detailColumns)
          } else {
            detailColumns = detailColumns.filter(item => item.dataIndex !== 'reasonID');
          }
        }
        this.setState({
          detailColumns,
        })
      }
    }
  }

  // 需换货切换
  handleDxchange = (value, dataIndex, record) => {
    let { detailTableData } = this.state;
    for (var i = 0; i < detailTableData.length; i++) {
      if (detailTableData[i].reqNo === record?.reqNo) {
        detailTableData[i][dataIndex] = value;
      }
    }
    this.setState({ detailTableData });
  }

  // 质检类型切换
  handleInspectTypeChange = () => {
    let { categoryData, detailTableData } = this.state;
    let isTips = true; // 相同类型则不需要提醒
    let currentInspectType = this.baseFormRef && this.baseFormRef.getFieldValue('inspectType');
    for (var i = 0; i < detailTableData.length; i++) {
      if (detailTableData[i].inspectType !== currentInspectType) {
        isTips = false;
        break;
      }
    }
    if (isTips) return;
    Modal.confirm({
      title: '质检单明细清除提醒',
      content: '质检类型切换会导致完成失败，是否清除明细数据重新添加???',
      okText: '确定清除',
      cancelText: '继续保留',
      onOk: () => {
        let detailIDIndex = categoryData?.detailIDIndex || 'id';
        let qualityInspectDetailArr = [];
        for (var i = 0; i < detailTableData.length; i++) {
          if (detailTableData[i][detailIDIndex]) {
            qualityInspectDetailArr.push(detailTableData[i][detailIDIndex]);
          }
        }
        if (qualityInspectDetailArr && qualityInspectDetailArr.length > 0) { // 删除已保存的
          this.handleDetailDelete('', '', qualityInspectDetailArr);
        }
        this.setState({ detailTableData: [], sumRp: 0, sumSp: 0 }, () => {
          this.handleInlineEditingMethodCall('setTableData', []); // 行内编辑列表赋值
        });
      },
      onCancel() { },
    });
  }

  // 查看详情
  handleViewDetails = (record, e) => {
    React.$stopPropagation(e);
    const { categoryData, rowData } = this.state;
    if (categoryData?.hideViewDetails !== 'Y') {
      this.matchingDetailsRef && this.matchingDetailsRef.modifyVisible(true, { ...record, suppFlag: categoryData?.componentName || '', statusCode: rowData?.statusCode });
    }
  }

  // 查询
  handleQuery = () => {
    this.setState({ page: 1, rowID: '' }, () => {
      this.getTableData();
    })
  }

  // 请求列表数据
  getTableData = async (isClear) => {
    try {
      let { categoryData, statusRadioData } = this.state;
      if (!(categoryData && categoryData.queryCode)) return;
      let values = await this.queryFormRef.handleSave();
      if (values.error) {
        message.error('请完善必填信息');
        return;
      }
      this.setState({ loading: true });
      let res = await React.$asyncPost(this, categoryData.queryCode, this.getMainListParams());
      let tableData = Util.addKeyValueToDataSource(res.result && 'rows' in res.result ? res.result.rows : (Array.isArray(res.result) ? res.result : []));
      let count = res.result?.count || [];
      for (let i = 0; i < statusRadioData.length; i++) {
        let currentObj = count.filter(item => item.id === statusRadioData[i].id);
        statusRadioData[i].count = currentObj && currentObj.length > 0 ? currentObj[0].count : 0;
      }
      this.setState({ tableData, total: res.result?.total || tableData.length, loading: false, statusRadioData }, () => {
        isClear !== 'N' ? this.handleClearSelectData() : ''; // 清除操作数据
      });
    } catch (error) {
      console.log('error', error);
      this.setState({ loading: false });
    }
  }

  // 单据状态change事件
  handleStatusRadioChange = e => {
    this.setState({ statusRadioVal: e.target.value }, () => {
      this.handleQuery();
    });
  }

  // 清除操作数据
  handleClearSelectData = () => {
    const { selectData } = this.state;
    this.setState({ rowID: '', rowData: {}, detailDeleteFlag: true, detailTableData: [], stepsData: selectData?.title || [], sumRp: 0, sumSp: 0 }, () => {
      this.handleFilterDetailColumns(); // 重新渲染明细表头数据
      this.getCurrentStep();
      this.handleIsDisabled('baseFormData');
      this.baseFormRef && this.baseFormRef.resetFields();
      this.handleInlineEditingMethodCall('setTableData', []); // 行内编辑列表赋值
    })
  }

  // 输入域是否可以操作
  handleIsDisabled = (dataIndex) => {
    let { categoryData, rowID, rowData } = this.state;
    let detailDeleteFlag = rowID ? ((rowData.statusCode === '10' || (rowData.statusCode === '40' && categoryData && categoryData.groupType !== 'G')) ? true : false) : true; // 退回时也可以修改
    let formData = this.state[dataIndex];
    for (var i = 0; i < formData.length; i++) {
      this.state[dataIndex][i].disabled = detailDeleteFlag ? this.state[dataIndex][i].defaultDisabled : 'Y';
    }
    this.setState({});
  }

  // 原因切换
  handleDetailInputChange = (val, index, dataIndex) => {
    let { detailTableData } = this.state;
    detailTableData[index][dataIndex] = val;
    if ((dataIndex === 'qualityResults' && val === 'Y') || (dataIndex === 'receiptStatus' && val === 'R')) { // 选择正常时清除不合格原因 -> 质量检查（合格为Y） / 采购收货（收货为R）
      detailTableData[index]['reasonID'] = undefined;
    }
    this.setState({});
  }

  // 分页操作
  compilePage = (page, pageSize) => {
    this.setState({ page, pageSize }, () => {
      this.getTableData();
    })
  }

  // 操作行
  onClickRowPublic = (record) => {
    const { categoryData } = this.state;
    let idIndex = categoryData?.idIndex || 'id';
    return {
      // 单击行选中
      onClick: () => {
        if (this.state.rowID === '' || (this.state.rowID && (this.state.rowID !== record[idIndex]))) {
          let detailDeleteFlag = !(record[idIndex]) || (record?.statusCode === (categoryData?.preAuditStatusCode || '10')) || (record?.statusCode === '40') || (categoryData?.componentName === 'IMGroupReturnOrderConfirmation' && record?.statusCode === '30');
          this.setState({ rowID: record[idIndex], detailDeleteFlag }, () => {
            this.queryRowDataByID(record);
          });
        } else {
          this.handleClearSelectData();
        }
      }
    }
  }

  // 选中行操作
  setRowClassNamePublic = (record) => {
    const { categoryData } = this.state;
    let idIndex = categoryData?.idIndex || 'id';
    return record[idIndex] === this.state.rowID ? 'clickRowStyle' : '';
  }

  // 根据行ID获取明细数据
  queryRowDataByID = async (record) => {
    try {
      const { categoryData, rowID } = this.state;
      let idIndex = categoryData?.idIndex || 'id';
      let queryDetailCode = categoryData?.queryDetailCode || '';
      // 明细操作状态，审核时和提交审核后不能操作
      const detailBtnDisabledFlag = categoryData && (
        categoryData.groupType === 'G' || categoryData?.operationType === 'audit') ? true :
        !(!rowID || (record && (record?.statusCode === (categoryData?.preAuditStatusCode || '10') || record?.statusCode === '40' || (categoryData?.componentName === 'IMGroupReturnOrderConfirmation' && record.statusCode === '60'))));
      if (!queryDetailCode) {
        this.setState({ rowData: record, detailTableData: [{ ...record, editingFlag: categoryData?.detailInlineEditingModifyBtnFlag === 'Y' || detailBtnDisabledFlag ? 'N' : '' }] }, () => {
          this.handleDetailEmpty();
          this.totalAmountCalculation();
          this.handleInlineEditingMethodCall('setTableData', [record], 'refreshColumns'); // 行内编辑列表赋值
        })
        return;
      };
      this.setState({ detailLoading: true });
      let data = {
        params: [{
          [idIndex]: rowID,
          groupType: categoryData?.groupType || undefined, //  H 医院   G集团
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, queryDetailCode, data);
      let rowData = res.result?.baseInfo || {}
      let detailTableData = Util.addKeyValueToDataSource(res.result?.detailInfo || []);
      for (var i = 0; i < detailTableData.length; i++) {
        detailTableData[i].editingFlag = categoryData?.detailInlineEditingModifyBtnFlag === 'Y' || detailBtnDisabledFlag ? 'N' : ''; // 根据编辑按钮控制，存在编辑按钮则默认不可编辑
        detailTableData[i].mainStatusCode = rowData?.statusCode || '';
        detailTableData[i].inspectType = rowData?.inspectType || '';
      }
      let componentNameArr = ['IMProcurementPlan', 'IMPurchasePlanReview', 'IMGroupPurchasePlanReview', 'IMGroupProcurementPlan', 'IMGroupReturnOrderConfirmation', 'IMGroupReturnOrderApproval', 'IMReturnVoucher'];
      if ((componentNameArr.indexOf(categoryData?.componentName)) > -1 || categoryData?.supplierValueDetailFlag === 'Y') { // 采购计划选择订单时需将当前订单的供应商数据set到基本信息供应商中
        this.state.selectData.vendor = this.getVendorData(detailTableData);
      }
      this.setState({
        rowData,
        detailTableData,
        detailLoading: false,
        stepsData: res.result?.title || [],
        sumRp: rowData?.sumRp || 0, // 进价总金额
        sumSp: rowData?.sumSp || 0, // 售价总金额
      }, () => {
        this.handleFilterDetailColumns(); // 重新渲染明细表头数据
        this.handleIsDisabled('baseFormData');
        this.handleDetailEmpty();
        this.getCurrentStep();
        this.handleInlineEditingMethodCall('setTableData', detailTableData, 'refreshColumns'); // 行内编辑列表赋值
      })
    } catch (error) {
      console.log(error)
      this.setState({ detailLoading: false });
    }
  }

  // 保存
  handleSave = async (statusCode, remark) => {
    const { detailTableData } = this.state;
    let baseValues = await this.baseFormRef.handleSave();
    // baseValues.remark = remark; // 退回原因/不放在表单数据中，可能会导致重复
    if (baseValues && baseValues.error) {
      message.info('请完善基本信息中的必填项。');
      return;
    }
    if (!(detailTableData && detailTableData.length > 0)) {
      message.error('请录入明细数据');
      return;
    } else {
      this.handleHttpSave(statusCode, baseValues, remark)
    }
  }

  // 调用接口保存
  handleHttpSave = async (statusCode, baseValues, remark) => {
    let { detailTableData, categoryData, rowData, rowID } = this.state;
    let idIndex = categoryData?.idIndex || 'id';
    try {
      if (!(categoryData && categoryData.saveCode)) {
        message.error('保存接口还未配置呢，快去配置先！');
        return;
      };
      // if (rowData && rowData.statusCode === '40') { // 重新提交时置空备注
      //   for (var i = 0; i < detailTableData.length; i++) {
      //     detailTableData[i].reasonID = undefined;
      //   }
      // }
      if (categoryData?.detailInlineEditingFlag === 'Y') { // 行内编辑
        detailTableData = this.lineEditableRef.handleSave();
        // 校验明细列表必填
        // let requiredMsg = '';
        // for (let i = 0; i < detailColumns.length; i++) {
        //   if (detailColumns[i].required === 'Y') {
        //     let currentDataIndex = detailColumns[i]?.dataIndex || detailColumns[i]?.code || '';
        //     for (let j = 0; j < detailTableData.length; j++) {
        //       if ()
        //     }
        //   }
        // }
      }
      if (statusCode === '10') {
        this.setState({ saveBtnLoading: true });
      } else if (statusCode === '20') {
        this.setState({ auditBtnLoading: true });
      }
      let data = {
        params: [{
          statusCode,
          // IMStockReturnApply - 科室退库申请接收界面特殊处理
          [idIndex]: categoryData?.groupType === 'G' ? rowID : undefined,
          remark: categoryData?.groupType === 'G' ? remark : undefined, // 退回原因，审核退回
          baseInfo: { ...rowData, ...baseValues },
          detailInfo: detailTableData,
        }]
      }
      let res = await React.$asyncPost(this, categoryData.saveCode, data);
      if (statusCode === '40') { // 退回成功需关闭原因弹窗
        this.returnOrderRef && this.returnOrderRef.modifyVisible && this.returnOrderRef.modifyVisible(false);
      }
      this.setState({ saveBtnLoading: false, auditBtnLoading: false });
      message.success(res?.errorMessage || '保存成功');
      this.getTableData();
    } catch (error) {
      if (error && error?.errorCode === '1000') {
        let errorReqNoArr = error && error.result && typeof (error.result) === 'string' && error.result.indexOf('^') > -1 ? error.result.split('^') : [error.result];
        for (let i = 0; i < detailTableData.length; i++) {
          detailTableData[i].errorReqNo = errorReqNoArr.indexOf(detailTableData[i].reqNo) > -1 ? 'Y' : 'N';
        }
        this.setState({});
      }
      this.setState({ saveBtnLoading: false, auditBtnLoading: false });
    }
  }

  // 清空明细表单数据
  handleDetailEmpty = () => {
    const { detailRowID } = this.state;
    if (detailRowID) {
      this.setState({ detailRowID: '' });
    }
  }

  // 添加明细数据
  handleAddDetailData = (data, baseDefault = {}) => {
    if (data && Array.isArray(data) && data.length > 0) {
      let { detailTableData, categoryData, rowID, rowData } = this.state;
      const detailBtnDisabledFlag = categoryData && (
        categoryData.groupType === 'G' || categoryData?.operationType === 'audit') ? true :
        !(!rowID || (rowData && (rowData?.statusCode === (categoryData?.preAuditStatusCode || '10') || rowData?.statusCode === '40' || (categoryData?.componentName === 'IMGroupReturnOrderConfirmation' && rowData.statusCode === '60'))));
      let currentInspectType = '';
      if (categoryData?.componentName === 'IMWarehousingInspect' || categoryData?.componentName === 'IMGroupWarehousingInspect') { // 入库质检
        currentInspectType = this.baseFormRef && this.baseFormRef.getFieldValue('inspectType');
      }
      for (var i = 0; i < data.length; i++) {
        if (categoryData?.detailInlineEditingFlag === 'Y') { // 行内编辑
          data[i].editingFlag = categoryData?.detailInlineEditingModifyBtnFlag === 'Y' || detailBtnDisabledFlag ? 'N' : '';
        }
        if (categoryData?.detailReasonModifyFlag === 'Y') { // 原因可编辑，置空原因重新选择
          data[i].reasonID = undefined;
        }
        if (categoryData?.componentName === 'IMPurchaseReceipt' || categoryData?.componentName === 'IMGroupPurchaseReceipt') { // 采购收货辅助制单默认为收货 - 后台有返回则取后台返回的
          data[i].receiptStatus = data[i]?.receiptStatus || 'R';
          data[i].receiptStatusDesc = data[i]?.requestStatusDesc || '收货';
        } else if (categoryData?.componentName === 'IMWarehousingInspect' || categoryData?.componentName === 'IMGroupWarehousingInspect') { // 质量检查
          data[i].inspectType = currentInspectType;
          data[i].qualityResults = data[i]?.qualityResults || 'Y';
          data[i].qualityResultsDesc = data[i]?.qualityResultsDesc || '合格';
        } else if (categoryData?.componentName === 'IMStockReturnApply') { // 科室退库申请
          data[i].exchange = data[i]?.exchange || 'Y'; // 默认需换货
        }
      }
      let nDetailTableData = Util.addKeyValueToDataSource([...detailTableData, ...data]);
      this.handleSupplierOperations(nDetailTableData, 'Y');
      this.setState({ detailTableData: nDetailTableData }, () => {
        this.totalAmountCalculation();
        this.handleFilterDetailColumns(); // 重新渲染明细表头数据
        this.handleInlineEditingMethodCall('handleMultilineAdd', data); // 行内编辑模式多行添加
        this.handleSetBaseDefault(baseDefault)
      });
    }
  }

  // 基本信息赋默认值 - 存在的话就不修改
  handleSetBaseDefault = (baseDefault) => {
    if (baseDefault && Object.prototype.toString.call(baseDefault) === '[object Object]' && JSON.stringify(baseDefault) !== '{}') {
      let values = {};
      let baseValues = this.baseFormRef && this.baseFormRef.getFieldsValue();
      for (let defaultKeys in baseDefault) {
        if (!(baseValues && defaultKeys in baseValues && baseValues[defaultKeys])) {
          values[defaultKeys] = baseDefault[defaultKeys];
        }
      }
      this.baseFormRef && this.baseFormRef.setFieldsValue(values);
    }
  }

  // 设置供应商下拉数据及默认值
  handleSupplierOperations = (tableData, isDefaultFlag) => {
    const { categoryData } = this.state;
    let baseValues = this.baseFormRef && this.baseFormRef.getFieldsValue();
    // 采购计划选、集团退货制单、退货申请择订单时需将当前订单的供应商数据set到基本信息供应商中
    let componentNameArr = ['IMProcurementPlan', 'IMPurchasePlanReview', 'IMGroupPurchasePlanReview', 'IMGroupProcurementPlan', 'IMGroupReturnOrderConfirmation', 'IMGroupReturnOrderApproval', 'IMReturnVoucher'];
    if ((componentNameArr.indexOf(categoryData?.componentName)) > -1 || categoryData?.supplierValueDetailFlag === 'Y') {
      let newVendorData = this.getVendorData(tableData);
      if (baseValues && 'vendorID' in baseValues && (!baseValues?.vendorID) && newVendorData && newVendorData.length === 1) {
        this.baseFormRef && this.baseFormRef.setFieldsValue({
          vendorID: newVendorData[0].id
        })
      }
      if (!!(baseValues?.vendorID)) {
        if (newVendorData && newVendorData.length > 0) {
          let isExistence = false;
          for (var i = 0; i < newVendorData.length; i++) {
            if (newVendorData[i].id === baseValues.vendorID) {
              isExistence = true;
              break;
            }
          }
          if (!isExistence) {
            this.baseFormRef && this.baseFormRef.setFieldsValue({
              vendorID: undefined
            })
            message.error('存在不同供应商，请重新选择');
          }
        } else {
          this.baseFormRef && this.baseFormRef.setFieldsValue({
            vendorID: undefined
          })
        }
      }
      this.state.selectData.vendor = newVendorData;
      isDefaultFlag === 'Y' && this.baseFormRef && this.baseFormRef.handleDefaultAssignment(); // 初始化表单更新数据
    } else {
      if (baseValues && 'vendorID' in baseValues && !baseValues?.vendorID && tableData && tableData.length > 0 && !!tableData[0]?.vendorID) { // 当基本信息中存在供应商并且为空时赋值行数据供应商
        this.baseFormRef && this.baseFormRef.setFieldsValue({
          vendorID: tableData[0].vendorID
        })
      }
    }
  }

  // 获取当前订单的供应商数据
  getVendorData = (data) => {
    let vendorData = [];
    if (data && Array.isArray(data) && data.length > 0) {
      for (var i = 0; i < data.length; i++) {
        if (data[i] && 'vendorArr' in data[i] && Array.isArray(data[i].vendorArr) && data[i].vendorArr.length > 0) {
          vendorData.push(...data[i].vendorArr)
        }
      }
    }
    return Util.unique(vendorData);
  }

  // 选择订单 / 辅助制单
  handleSelectOrder = () => {
    const { categoryData, selectData } = this.state;
    if (categoryData?.componentName === 'IMWarehousingInspect' || categoryData?.componentName === 'IMGroupWarehousingInspect') { // 入库质检点击辅助制单时重新获取订单状态下拉数据（及重新调用初始化接口）
      let currentInspectType = this.baseFormRef && this.baseFormRef.getFieldValue('inspectType');
      if (this.state.currentInspectType !== currentInspectType) { // 判断点击辅助制单时质检类型是否切换
        let orderModalType = Util.returnDataCccordingToAttributes(selectData?.inspectType || [], currentInspectType)?.type || '';
        this.setState({ currentInspectType, orderModalType }, () => {
          this.getSelectData(this.handleShowOrderOfGlasses);
        })
        return;
      }
    }
    this.handleShowOrderOfGlasses();
  }

  // 打开辅助制单弹窗
  handleShowOrderOfGlasses = () => {
    // 供给科室
    const { categoryData } = this.state;
    let auxiliaryLocIDIndex = categoryData?.auxiliaryLocIDIndex || 'frLocID';
    let values = this.baseFormRef && this.baseFormRef.getFieldsValue();
    // 采购计划辅助制单不默认供应商根据当前选择的供应商去查询数据
    let componentNameArr = ['IMProcurementPlan', 'IMPurchasePlanReview', 'IMGroupProcurementPlan', 'IMGroupPurchasePlanReview']
    let vendorID = componentNameArr.indexOf(categoryData?.componentName) > -1 ? '' : (values?.vendorID || '');
    this.setState({ frLocID: values[auxiliaryLocIDIndex], vendorID }, () => { // 供应商用于辅助制单
      this.orderOfGlassesRef && this.orderOfGlassesRef.modifyVisible(true, categoryData?.assistComponentName || '', categoryData?.assistModalDoNotDefaultHosp || 'N');
    })
  }

  // 明细行操作
  handleDetailRowClick = (record) => {
    const { categoryData } = this.state;
    return {
      // 单击行选中
      onClick: () => {
        if (categoryData?.detailRowClickFlag === 'Y') {
          if (this.state.detailRowID === '' || (this.state.detailRowID && (this.state.detailRowID !== record.key))) {
            this.setState({ detailRowID: record.key });
          } else {
            this.handleDetailEmpty();
          }
        }
      },
      onDoubleClick: () => {
        this.handleViewDetails(record)
      }
    }
  }

  handleDetailRowClassName = (record) => {
    return record.key === this.state.detailRowID ? 'clickRowStyle' : (record?.presChange === '是' ? 'common-row-color-FDECF2' : '');
  }

  // 更改单据状态
  handleModifyOrderStatus = async (statusCode) => {
    try {
      const { categoryData, rowID } = this.state;
      if (!(categoryData && categoryData.idIndex && categoryData.revokeCode)) {
        message.error('撤销接口还未配置呢，快去配置先！');
        return
      };
      let data = {
        params: [{
          [categoryData.idIndex]: rowID,
          statusCode,
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, categoryData.revokeCode, data);
      message.success(res?.errorMessage || '订单撤回成功');
      this.getTableData();
    } catch (error) {
      console.log(error)
    }
  }

  // 录入顺序
  handleEntrySequence = (componentName) => {
    componentName && this.baseFormRef && this.baseFormRef.showFromMaintenanceModal(componentName);
  }

  // 批量修改申请单状态
  modifyApplicationFormStatus = async (statusCode, requestIDArr, compnentSource, remark) => {
    try {
      const { categoryData, returnFlag, selectedRowKeys } = this.state;
      if (returnFlag === 'save' || returnFlag === 'orderReturn') { // 集团退回，走保存接口传入40
        this.handleSave(statusCode, remark);
        return;
      }
      let cRequestIDArr = this.getDetailTableRequestID();
      let data = {
        params: [{
          // assistModalModifyStatusIDIndex - 修改状态后台接收ID字段
          [categoryData?.assistModalModifyStatusIDIndex || 'requestIDArr']: selectedRowKeys && selectedRowKeys.length > 0 ? selectedRowKeys : cRequestIDArr,
          statusCode,
          remark, // 退回时填写，退回原因
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      // assistModaModifyStatusCode - assistModaModifyStatusCode
      let res = await React.$asyncPost(this, categoryData?.assistModaModifyStatusCode || '17030026', data);
      if (returnFlag === 'detailReturn') { // 明细列退回，医院退回
        this.returnOrderRef.modifyVisible && this.returnOrderRef.modifyVisible(false);
      }
      message.success(res.errorMessage || '操作成功');
      this.queryRowDataByID();
    } catch (error) {
      console.log(error);
      // 修改失败，清除loading信息
      this.returnOrderRef && this.returnOrderRef.clearLoading();
    }
  }

  // 获取明细列表申请单ID
  getDetailTableRequestID = () => {
    let { categoryData, detailTableData } = this.state;
    let requestIDArr = [];
    for (var i = 0; i < detailTableData.length; i++) {
      // assistModalIDIndex - 修改状态ID字段
      requestIDArr.push(detailTableData[i][categoryData?.assistModalIDIndex || 'glassesRequestID']);
    }
    return requestIDArr;
  }

  // 删除
  handleDelete = async (record, e) => {
    try {
      React.$stopPropagation(e);
      const { categoryData, rowID } = this.state;
      let idIndex = categoryData?.idIndex || 'id';
      let deleteCode = categoryData?.deleteCode || '';
      if (!deleteCode || !idIndex) {
        message.error('删除接口还未配置呢，快去配置先！');
        return
      };
      let data = {
        params: [{
          [idIndex]: record[idIndex] || '',
          groupType: categoryData?.groupType || undefined, //  H 医院   G集团
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, deleteCode, data);
      message.success(res.errorMessage || '删除成功');
      this.getTableData(rowID === record[idIndex] ? 'Y' : 'N');
    } catch (error) {
      console.log(error)
    }
  }

  // 删除明细
  handleDetailDelete = async (record, e, detailArr = []) => {
    try {
      React.$stopPropagation(e);
      const { categoryData, detailRowID } = this.state;
      let detailIDIndex = categoryData?.detailIDIndex || 'id';
      let detailDeleteIndex = detailIDIndex && typeof (detailIDIndex) === 'string' && detailIDIndex.indexOf('ID') > -1 && detailIDIndex.replace('ID', 'Arr');
      if ((record && record[detailIDIndex]) || (detailArr && detailArr.length > 0)) { // 调用接口删除
        let detailDeleteCode = categoryData?.detailDeleteCode || categoryData?.deleteCode || ''; // 默认和主删除接口一样
        if (!detailDeleteCode || !detailIDIndex) {
          message.error('明细接口还未配置呢，快去配置先！');
          return
        };
        let data = {
          params: [{
            [detailDeleteIndex]: detailArr && detailArr.length > 0 ? detailArr : [record[detailIDIndex]],
            groupType: categoryData?.groupType || undefined, //  H 医院   G集团
            componentName: categoryData?.componentName || undefined, // 组件名
          }]
        }
        let res = await React.$asyncPost(this, detailDeleteCode, data);
        if (!(detailArr && detailArr.length > 0)) {
          message.success(res.errorMessage || '删除成功');
        }
      }
      if (!(detailArr && detailArr.length > 0)) {
        this.handleRowDelete(record);
        if (record.key === detailRowID) {
          this.handleDetailEmpty();
        }
      }
    } catch (error) {
      console.log(error)
    }
  }

  // 本地删除数据
  handleRowDelete = (record) => {
    let { detailTableData, categoryData } = this.state;
    // 存在申请单ID的按glassesRequestID删除，一个订单存在多条的情况
    // let componentNameArr = ['IMProcurementPlan', 'IMGroupProcurementPlan'];
    let requestIDIndex = categoryData?.assistModalIDIndex || 'glassesRequestID';
    if (record && requestIDIndex in record && record[requestIDIndex]) {
      detailTableData = detailTableData.filter(item => item[requestIDIndex] !== record[requestIDIndex]);
    } else {
      detailTableData = detailTableData.filter(item => item.key !== record.key);
    }
    this.setState({ detailTableData: Util.addKeyValueToDataSource(detailTableData) }, () => {
      this.totalAmountCalculation();
    });
  }

  // 退回订单
  handleReturnOrder = (statusCode, returnFlag) => {
    this.setState({ returnFlag }, () => {
      this.returnOrderRef && this.returnOrderRef.modifyVisible && this.returnOrderRef.modifyVisible(true, {}, statusCode);
    })
  }

  // 明细行数据退回
  handleDetailRowDataReturn = (statusCode, requestIDArr, e) => {
    const { categoryData } = this.state;
    React.$stopPropagation(e);
    this.setState({ returnFlag: 'detailReturn', selectedRowKeys: requestIDArr }, () => {
      if (categoryData?.detailReturnRemarkFlag === 'Y') { // 明细退回是否填写原因 - 默认是不填写以免影响之前的界面
        this.modifyApplicationFormStatus && this.modifyApplicationFormStatus(statusCode);
      } else {
        this.returnOrderRef && this.returnOrderRef.modifyVisible && this.returnOrderRef.modifyVisible(true, {}, statusCode);
      }
    });
  }

  // 详情界面退回订单
  handleDetailsReturnOrder = (record, statusCode) => {
    const { categoryData } = this.state;
    this.setState({ returnFlag: 'detailReturn', selectedRowKeys: [record[categoryData?.assistModalIDIndex || 'glassesRequestID']] }, () => {
      this.returnOrderRef && this.returnOrderRef.modifyVisible(true, {}, statusCode);
    })
  }

  // 扫码入库
  handleScanningCodePressEnter = async () => {
    try {
      const { categoryData, detailTableData, scanningCode, baseFormData, orderModalType, } = this.state;
      let auxiliaryLocIDIndex = categoryData?.auxiliaryLocIDIndex || 'frLocID';
      let locID = this.baseFormRef && this.baseFormRef.getFieldValue(auxiliaryLocIDIndex);
      if (!locID && categoryData?.auxiliaryNotRequiredLocFlag !== 'Y') { // auxiliaryNotRequiredLocFlag - 辅助制单不校验科室
        let auxiliaryLocData = baseFormData && baseFormData.filter(item => item.dataIndex === auxiliaryLocIDIndex);
        let auxiliaryLocDesc = auxiliaryLocData && auxiliaryLocData.length > 0 ? auxiliaryLocData[0].descripts : '供给科室';
        message.error('请先选择' + auxiliaryLocDesc);
        return;
      }
      if (!scanningCode) return;
      let data = {
        params: [{
          productNo: scanningCode,
          frLocID: locID,
          [auxiliaryLocIDIndex]: locID,
          type: orderModalType,
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, categoryData?.code || '17030034', data);
      let detailObj = res && 'result' in res && Object.prototype.toString.call(res.result) === '[object Object]' ? res.result : {};
      // 判断当前明细列表是否已添加该产品
      let addFlag = true;
      for (var i = 0; i < detailTableData.length; i++) {
        if (detailObj && 'productNo' in detailObj && detailTableData[i].productNo === detailObj.productNo) {
          addFlag = false;
          break;
        }
      }
      if (!addFlag) {
        message.error('当前订单已添加，无需重复添加');
        setTimeout(() => {
          this.scanningRef.current?.focus();
        }, 300)
        return;
      }
      detailObj.key = detailTableData && detailTableData.length > 0 ? detailTableData.length + 1 : 1;
      if (categoryData?.detailReasonModifyFlag === 'Y') { // 原因可编辑，置空原因重新选择
        detailObj.reasonID = undefined;
      }
      if (categoryData?.componentName === 'IMPurchaseReceipt' || categoryData?.componentName === 'IMGroupPurchaseReceipt') { // 采购收货辅助制单默认为收货 - 后台有返回则取后台返回的
        detailObj.receiptStatus = detailObj?.receiptStatus || 'R';
        detailObj.receiptStatusDesc = detailObj?.requestStatusDesc || '收货';
      } else if (categoryData?.componentName === 'IMWarehousingInspect' || categoryData?.componentName === 'IMGroupWarehousingInspect') { // 入库质检
        let currentInspectType = this.baseFormRef && this.baseFormRef.getFieldValue('inspectType');
        detailObj.inspectType = currentInspectType;
        detailObj.qualityResults = detailObj?.qualityResults || 'Y';
        detailObj.qualityResultsDesc = detailObj?.qualityResultsDesc || '合格';
      } else if ((categoryData?.componentName === 'IMStockReturnApply') || (categoryData?.componentName === 'IMReturnVoucher')) { // 科室退库申请、退货申请
        detailObj.exchange = detailObj?.exchange || 'Y'; // 默认需换货
      }
      // let baseValues = this.baseFormRef && this.baseFormRef.getFieldsValue();
      // if (!baseValues?.vendorID && !!detailObj?.vendorID) { // 当基本信息中存在供应商选择框并且为空时赋值行数据供应商
      //   this.baseFormRef && this.baseFormRef.setFieldsValue({
      //     vendorID: detailObj.vendorID
      //   })
      // }
      let nDetailTableData = [...detailTableData, detailObj]
      // let componentNameArr = ['IMProcurementPlan', 'IMPurchasePlanReview', 'IMGroupPurchasePlanReview', 'IMGroupProcurementPlan', 'IMGroupReturnOrderConfirmation', 'IMGroupReturnOrderApproval', 'IMReturnVoucher'];
      // if (componentNameArr.indexOf(categoryData?.componentName) > -1 || categoryData?.supplierValueDetailFlag === 'Y') { // 采购计划选择订单时需将当前订单的供应商数据set到基本信息供应商中
      //   this.state.selectData.vendor = this.getVendorData(nDetailTableData);
      // }
      this.handleSupplierOperations(nDetailTableData);
      this.setState({ detailTableData: nDetailTableData, scanningCode: undefined }, () => {
        this.totalAmountCalculation();
        this.handleFilterDetailColumns(); // 重新渲染明细表头数据
        this.handleInlineEditingMethodCall('handleMultilineAdd', [detailObj]); // 行内编辑模式多行添加
        setTimeout(() => {
          this.scanningRef.current?.focus();
        }, 300)
      });
    } catch (error) {
      console.log(error)
    }
  }

  // 计算进价总金额/售价总金额
  totalAmountCalculation = (recordAmtComputeFlag, currentQty) => {
    const { detailTableData, categoryData } = this.state;
    let spCountDataIndex = categoryData?.spCountDataIndex || 'sp';
    let rpCountDataIndex = categoryData?.rpCountDataIndex || 'rp';
    let qtyCountDataIndex = categoryData?.qtyCountDataIndex || 'qty';
    let sumRp = 0; // 进价总金额
    let sumSp = 0; // 售价总金额
    for (let i = 0; i < detailTableData.length; i++) {
      let recordRp = parseFloat((detailTableData[i][rpCountDataIndex] || 0));
      recordRp = recordRp.toFixed(4).replace('.', ''); // 去掉小数点
      recordRp = parseFloat(recordRp); // 转换成数字类型
      let recordSp = parseFloat((detailTableData[i][spCountDataIndex] || 0));
      recordSp = recordSp.toFixed(4).replace('.', '');
      recordSp = parseFloat(recordSp);
      let recordQty = parseFloat(recordAmtComputeFlag ? currentQty : (detailTableData[i][qtyCountDataIndex] || 0)); // 行内编辑传入实施数量
      recordQty = recordQty.toFixed(4).replace('.', '');
      recordQty = parseFloat(recordQty);
      if (categoryData?.detailInlineCountAmtFlag === 'Y' && recordAmtComputeFlag !== 'N') { // 行内编辑是否计算进价、售价总金额
        detailTableData[i][categoryData?.detailRecordRpAmt || 'rpAmt'] = (recordRp * recordQty) / 100000000;
        detailTableData[i][categoryData?.detailRecordSpAmt || 'spAmt'] = (recordSp * recordQty) / 100000000;
      }
      sumRp += recordRp * recordQty; // 保留四位小数
      sumSp += recordSp * recordQty;
    }
    this.setState({ sumRp: sumRp / 100000000, sumSp: sumSp / 100000000 });
  }

  // 审核
  handleAudit = async () => {
    try {
      const { categoryData, rowID } = this.state;
      if (!(categoryData && categoryData.idIndex && categoryData.auditCode)) {
        message.error('审核接口还未配置呢，快去配置先！');
        return
      };
      let data = {
        params: [{
          [categoryData.idIndex]: rowID,
          [categoryData.idIndex + 'Arr']: [rowID],
          // 退货单处理状态接收状态为30
          statusCode: categoryData?.componentName === 'IMReturnVoucher' ? '30' : (categoryData?.postAuditStatusCode || undefined),
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, categoryData.auditCode, data);
      message.success(res?.errorMessage || '审核成功');
      this.getTableData();
    } catch (error) {
      console.log(error)
    }
  }

  // 撤销
  handleRevoke = async () => {
    try {
      const { categoryData, rowID } = this.state;
      if (!(categoryData && categoryData.idIndex && categoryData.revokeCode)) {
        message.error('审核接口还未配置呢，快去配置先！');
        return
      };
      let data = {
        params: [{
          [categoryData.idIndex]: rowID,
          [categoryData.idIndex + 'Arr']: [rowID],
          // 退货单处理状态接收状态为30
          statusCode: categoryData?.componentName === 'IMReturnVoucher' ? '30' : (categoryData?.postAuditStatusCode || undefined),
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, categoryData.revokeCode, data);
      message.success(res?.errorMessage || '撤销成功');
      this.getTableData();
    } catch (error) {
      console.log(error)
    }
  }


  // 向外输出明细列表数据
  getDetailTableData = () => {
    const { detailTableData } = this.state;
    return detailTableData;
  }

  // 导出
  handleExport = async () => {
    try {
      let { categoryData } = this.state;
      if (!(categoryData && categoryData.mainListExportCode)) {
        message.error('导出接口未配置，快去配置先！');
        return
      };
      this.setState({ exportLoading: true });
      let res = await React.$asyncPost(this, categoryData.mainListExportCode, this.getMainListParams());
      handleExcel.downloadExcel(res.result);
      this.setState({ exportLoading: false });
    } catch (error) {
      this.setState({ exportLoading: false });
    }
  }

  // 其他导出 - ERP导出
  handleERPExport = async () => {
    try {
      let { categoryData } = this.state;
      if (!(categoryData && categoryData.mainListERPExportCode)) {
        message.error('ERP导出接口未配置，快去配置先！');
        return
      };
      this.setState({ ERPExportLoading: true });
      let res = await React.$asyncPost(this, categoryData.mainListERPExportCode, this.getMainListParams());
      if (categoryData?.ReactExportERPFlag === 'Y') { // 前端导出ERP标志
        this.handleReactExportData(res);
      } else {
        handleExcel.downloadExcel(res.result);
      }
      this.setState({ ERPExportLoading: false });
    } catch (error) {
      this.setState({ ERPExportLoading: false });
    }
  }

  // GSP导出
  handleGSPExport = async () => {
    try {
      let { categoryData } = this.state;
      if (!(categoryData && categoryData.mainListGSPExportCode)) {
        message.error('GSP导出接口未配置，快去配置先！');
        return
      };
      this.setState({ GSPExportLoading: true });
      let res = await React.$asyncPost(this, categoryData.mainListGSPExportCode, this.getMainListParams());
      if (categoryData?.reactExportGSPFlag === 'Y') { // 前端导出GSP标志
        this.handleReactExportData(res);
      } else {
        handleExcel.downloadExcel(res.result);
      }
      this.setState({ GSPExportLoading: false });
    } catch (error) {
      this.setState({ GSPExportLoading: false });
    }
  }

  // 获取主列表查询条件
  getMainListParams = () => {
    let { categoryData, userData, statusRadioVal, pageSize, page, statusFormItem } = this.state;
    let values = this.queryFormRef && this.queryFormRef.getFieldsValue();
    let data = {
      params: [{
        hospID: userData?.hospID || '', // 表单有取表单的，没有取session的
        ...values,
        [categoryData?.stateSpreadingFlag === 'Y' ? (statusFormItem?.dataIndex || 'status') : '']: statusRadioVal,
        groupType: categoryData?.groupType || undefined, //  H 医院   G集团
        componentName: categoryData?.componentName || undefined, // 组件名
      }],
      pagination: [{
        pageSize,
        currentPage: page
      }]
    }
    return data;
  }

  // 前端导出ERP - 数据量多的情况每次调用固定的条数，分页请求，最后拿到全部数据再导出
  handleReactExportData = async (res) => {
    let tableData = res.result?.rows || [];
    if (tableData && tableData.length > 0) {
      handleExcel.exportExcel(res.result?.columns || [], res.result?.rows || [], res.result?.fileName || '采购制单', '', res.result?.type || 'xlsx', res.result?.sheetName || 'mySheet');
    } else {
      message.error('前端导出异常，请检查返回数据！')
    }
  }

  // 明细导出
  handleDetailExport = async (type, exportCode, exportFlag) => {
    try {
      const { categoryData, rowID } = this.state;
      if (!(categoryData && categoryData.idIndex && exportCode)) {
        message.error('导出接口未配置或主列表id未定义，请检查配置项！');
        return
      };
      this.state[type] = true;
      this.setState({});
      let data = {
        params: [{
          [categoryData.idIndex]: rowID,
          groupType: categoryData?.groupType || undefined, //  H 医院   G集团
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, exportCode, data);
      if (categoryData && exportFlag in categoryData && categoryData[exportFlag] === 'Y') { // 前端导出标志
        let columns = res.result?.columns || [];
        let tableData = res.result?.rows || [];
        if (columns && columns.length > 0 && tableData && tableData.length > 0) {
          handleExcel.exportExcel(columns, tableData, res.result?.fileName || '采购制单', '', res.result?.type || 'xlsx', res.result?.sheetName || 'mySheet');
        } else {
          message.error('前端导出异常，请检查返回数据！');
        }
      } else {
        handleExcel.downloadExcel(res.result);
      }
      this.state[type] = false;
      this.setState({});
    } catch (error) {

      this.state[type] = false;
      this.setState({});
    }
  }

  // 打印
  handlePrint = async () => {
    try {
      const { categoryData, rowID } = this.state;
      if (!(categoryData && categoryData.idIndex && categoryData.printCode)) {
        message.error('打印接口未配置或主列表id未定义，请检查配置项！');
        return
      };
      this.setState({ printBtnLoading: true });
      let data = {
        params: [{
          [categoryData.idIndex]: rowID,
          groupType: categoryData?.groupType || undefined, //  H 医院   G集团
          componentName: categoryData?.componentName || undefined, // 组件名
        }]
      }
      let res = await React.$asyncPost(this, categoryData.printCode, data);
      this.setState({ printBtnLoading: false });
      let dataArr = res?.result || [];
      dataArr && dataArr.map((item, i) => {
        $loopPrint(item.template, item.printStr);
      })
    } catch (error) {
      console.log(error);
      this.setState({ printBtnLoading: false });
    }
  }

  // 控制左侧card显隐
  handleChangeLeftCardFlag = () => {
    this.setState({
      leftCardFlag: !this.state.leftCardFlag
    })
  }

  // 明细行内编辑模式按钮操作
  handleInlineEditingMethodCall = (operation, params, type = '') => {
    const { categoryData } = this.state;
    if (categoryData?.detailInlineEditingFlag === 'Y') { // 行内编辑
      operation && this.lineEditableRef && this.lineEditableRef[operation](params, type);
    }
  }

  // 行内编辑明细列表多选操作
  handleDetailInlineRowSelection = (selectedRowKeys, selectedRows) => {
    this.setState({ detailSelectedRowKeys: selectedRowKeys });
  }

  // 行内编辑更新明细列表的值
  updateDetailTableData = (data) => {
    this.handleSupplierOperations(data, 'Y');
    this.setState({ detailTableData: data }, () => {
      this.totalAmountCalculation();
    });
  }

  // 辅助收货按钮菜单点击
  handleAuxiliaryMenuClick = (e) => {
    const { selectData, categoryData } = this.state;
    let menuData = categoryData && categoryData?.auxiliaryMenuBtnDataIndex && selectData[categoryData?.auxiliaryMenuBtnDataIndex];
    if (menuData && Array.isArray(menuData)) {
      let recordData = menuData[parseInt(e?.key) - 1];
      this.setState({ orderModalType: recordData?.type || recordData?.id || '', assistModalTitle: recordData?.title || recordData?.descripts || '' }, () => {
        this.handleSelectOrder(); // 打开辅助制单弹窗
      });
    }
  }

  // 获取供给科室 - 用于获取产品名称弹窗列表
  getFrLocID = () => {
    const { categoryData, baseFormData } = this.state;
    let auxiliaryLocIDIndex = categoryData?.auxiliaryLocIDIndex || 'frLocID';
    let locID = this.baseFormRef && this.baseFormRef.getFieldValue(auxiliaryLocIDIndex);
    if (!locID && categoryData?.auxiliaryNotRequiredLocFlag !== 'Y') { // auxiliaryNotRequiredLocFlag - 辅助制单不校验科室
      let auxiliaryLocData = baseFormData && baseFormData.filter(item => item.dataIndex === auxiliaryLocIDIndex);
      let auxiliaryLocDesc = auxiliaryLocData && auxiliaryLocData.length > 0 ? auxiliaryLocData[0].descripts : '供给科室';
      message.error('请先选择' + auxiliaryLocDesc);
      return { error: true };
    }
    return {
      frLocID: locID,
      [auxiliaryLocIDIndex]: locID
    }
  }

  // 导入明细数据
  handleImportDetailDate = (file, fileList) => {
    let { categoryData } = this.state;
    handleExcel.importExcel(file, categoryData?.detailImportExcelHandlingMethod !== 'none' ? 'keyVal' : '')
      .then(async (jsonData) => {
        let excelData = [];
        if (!!(categoryData?.detailImportExcelCode)) { // 需要调用接口的情况
          let data = {
            params: [{
              [categoryData.detailImportExcelDataIndex || 'importArr']: jsonData,
              componentName: categoryData?.componentName || undefined, // 组件名
            }]
          }
          let res = await React.$asyncPost(this, categoryData?.detailImportExcelCode || '', data);
          let result = res?.result || {};
          excelData = Array.isArray(result) ? result : (result?.rows || result?.data || []);
        } else if (categoryData?.detailImportExcelHandlingMethod === 'keyValColumns') { // 如果表头是描述的情况 - 将导入数据和明细表头对比得到最终数据
          excelData = Array.isArray(jsonData) ? Util.processingImportedDataBasedOnColumns(jsonData, detailColumns) : [];
        } else { // 正常显示
          excelData = Array.isArray(jsonData) ? jsonData : [];
        }
        this.handleAddDetailData(excelData);
      })
      .catch((error) => {
        console.error(error); // 处理错误
      });
    return false;
  }

  // 渲染明细列表操作按钮
  renderDetailOperations = (text, record) => {
    const { categoryData, detailDeleteFlag } = this.state;
    return (
      <span>
        {detailDeleteFlag ? (
          <>
            <Icon type="delete" className="common-record-delete-span"></Icon>
            <Popconfirm
              placement="topRight"
              title="删除后不可恢复，确定要删除吗?"
              onClick={React.$stopPropagation}
              onCancel={React.$stopPropagation}
              onConfirm={(e) => this.handleDetailDelete(record, e)}
            >
              <span className="span common-record-delete-span">删除</span>
            </Popconfirm>
          </>
        ) : (categoryData?.detailReturnAlwaysDisplayFlag !== 'Y' ? ( // 明细退回按钮始终显示标志
          <>
            <Icon type="delete" style={{ color: '#999' }}></Icon>
            <span
              style={{ color: '#999', cursor: 'no-drop', fontWeight: 'normal' }}
              onClick={React.$stopPropagation}
            >
              删除
            </span>
          </>
        ) : '')}
        {record.statusCode === '21' || (categoryData && 'mainRowStatusCode' in categoryData && 'detailRowStatusCode' in categoryData && (categoryData?.mainRowStatusCode.indexOf(record?.mainStatusCode) > -1) && (categoryData?.detailRowStatusCode.indexOf(record?.statusCode) > -1)) ? ( // 21-集团采购中心退回到采购计划才能退回到专科库房
          <>
            {detailDeleteFlag || categoryData?.detailReturnAlwaysDisplayFlag !== 'Y' ? <Divider type="vertical" /> : ''}
            <Popconfirm
              placement="topRight"
              title={categoryData?.detailReturnPopconfirmTitle || '订单退回后将回传到视光专科库房，确认需要退回吗?'}
              onClick={React.$stopPropagation}
              onCancel={React.$stopPropagation}
              onConfirm={(e) => this.handleDetailRowDataReturn(categoryData?.detailReturnStatusCode || '25', [record[categoryData?.assistModalIDIndex || 'glassesRequestID']], e)}
            >
              <span className="span common-record-delete-span">
                {categoryData?.detailReturnBtnTitle || '退回'}
              </span>
            </Popconfirm>
          </>
        ) : (!detailDeleteFlag && categoryData?.detailReturnAlwaysDisplayFlag === 'Y' ? ( // 明细退回按钮始终展示时并且如果删除不能操作的情况下展示不可操作退回按钮
          <>
            {detailDeleteFlag || categoryData?.detailReturnAlwaysDisplayFlag !== 'Y' ? <Divider type="vertical" /> : ''}
            <span
              style={{ color: '#999', cursor: 'no-drop', fontWeight: 'normal' }}
              onClick={React.$stopPropagation}
            >
              {categoryData?.detailReturnBtnTitle || '退回'}
            </span>
          </>
        ) : '')}
      </span>
    )
  }

  render() {
    let { categoryData, selectData, queryFormData, queryHeight, statusRadioData, statusRadioVal, columns, totalWidth, tableData, page, total, loading, rowData, rowID, spinLoading, stepsData, currentStep, exportLoading,
      detailTableData, detailColumns, detailTotalWidth, baseFormData, queryWidth, scanningCode, orderModalType, assistModalTitle, frLocID, sumRp, sumSp, detailLoading, defaultDate, vendorID, saveBtnLoading, auditBtnLoading, recordSaveLoading,
      statusFormItem, printBtnLoading, leftCardFlag, detailSelectedRowKeys, ERPExportLoading, GSPExportLoading, detailExportBtnLoading, detailExportGSPBtnLoading, detailDeleteFlag
    } = this.state;
    let firstCol = queryFormData && queryFormData.length > 0 ? queryFormData[0].col : 12;
    let firstLabelCol = queryFormData && queryFormData.length > 0 ? queryFormData[0].labelCol : 8;
    let statusWidth = parseInt((queryWidth / 24 * firstCol) / 24 * firstLabelCol);
    let stepsWidth = (stepsData?.length || 0) * 200 < 1000 ? 1000 : stepsData?.length * 200;
    let detailComponentName = categoryData?.childComponentName || (categoryData.componentName ? (categoryData.componentName + 'Detail') : '');
    // 列表操作
    const operationObj = {
      width: 80,
      title: '操作',
      align: 'center',
      key: 'operation',
      fixed: categoryData?.operationFixedFlag === 'Y' ? 'right' : null,
      render: (text, record) => (
        <span>
          <Icon type="delete" className="common-record-delete-span" style={{ color: record.deleteFlag === 'Y' ? 'red' : '#999' }}></Icon>
          {record && record.deleteFlag === 'Y' ? (
            <Popconfirm
              title="删除后不可恢复，确定要删除吗?"
              onClick={React.$stopPropagation}
              onCancel={React.$stopPropagation}
              onConfirm={(e) => this.handleDelete(record, e)}
            >
              <span className="span common-record-delete-span">删除</span>
            </Popconfirm>
          ) : (
            <span
              style={{ color: '#999', cursor: 'no-drop', fontWeight: 'normal' }}
              onClick={React.$stopPropagation}
            >
              删除
            </span>
          )}
        </span>
      ),
    };

    let detailOperationObj = {
      width: 100,
      title: '操作',
      align: 'center',
      key: 'operation',
      fixed: 'right',
      render: (text, record) => {
        return this.renderDetailOperations(text, record)
      },
    };

    const mainCardTitle = (categoryData?.cardTitle || '主') + '列表';
    // 明细操作按钮状态【辅助制单，行内编辑操作按钮】，审核时和提交审核后不能操作
    const detailBtnDisabledFlag = categoryData && (
      categoryData.groupType === 'G' || categoryData?.operationType === 'audit') ? true :
      !(!rowID || (rowData && (rowData?.statusCode === (categoryData?.preAuditStatusCode || '10') || rowData?.statusCode === '40' || (categoryData?.componentName === 'IMGroupReturnOrderConfirmation' && rowData.statusCode === '60'))));

    // 辅助制单多按钮菜单数据
    const auxiliaryMenuData = selectData && categoryData?.auxiliaryMenuBtnDataIndex && selectData[categoryData?.auxiliaryMenuBtnDataIndex] && Array.isArray(selectData[categoryData?.auxiliaryMenuBtnDataIndex]) ? selectData[categoryData?.auxiliaryMenuBtnDataIndex] : [];
    const auxiliaryMenu = (
      <Menu onClick={this.handleAuxiliaryMenuClick}>
        {auxiliaryMenuData && auxiliaryMenuData.map((item, index) => {
          return <Menu.Item key={item?.id || index}>{item?.title || item?.descripts || ''}</Menu.Item>
        })}
      </Menu>
    );

    // 导入按钮入参
    const detailUploadExcelParams = {
      accept: '.xls,.xlsx',
      name: 'file',
      headers: {
        authorization: 'authorization-text',
      },
      showUploadList: false,
      beforeUpload: this.handleImportDetailDate
    }
    return (
      <Spin
        tip={exportLoading || ERPExportLoading || GSPExportLoading ? '正在导出数据，请耐心等待…' : (recordSaveLoading ? '数据保存中…' : '正在初始化表单数据……')}
        spinning={spinLoading || exportLoading || ERPExportLoading || GSPExportLoading || recordSaveLoading}
      >
        <div style={{ height: store.getState().tableHeight.y + 243 + 'px' }} className="dynamic-component common-voucher-preparation inventory-management flex">
          {!leftCardFlag ? (
            <Card
              size="small"
              bordered={false}
              className="table-body-height"
              style={{ width: '620px' }}
              title={(
                <div className="card-title-left-img">
                  <img src={iconListvisits} alt="" />
                  {mainCardTitle}
                </div>
              )}
              extra={(
                <div onClick={this.handleChangeLeftCardFlag}>
                  <Tooltip title={'隐藏' + mainCardTitle}>
                    <Icon type="double-left" className="cvp-card-hide-icon" />
                  </Tooltip>
                </div>
              )}
            >
              <div ref={this.queryRef} className="cvp-left-card-query">
                <DynamicRenderingForm
                  className="dynamic-component-form"
                  onRef={ref => this.queryFormRef = ref}
                  rowData={{}}
                  selectData={selectData}
                  formData={queryFormData}
                />
                {categoryData?.stateSpreadingFlag === 'Y' ? ( // 单据状态是否铺开显示
                  <div className="flex">
                    <div style={{ width: statusWidth + 'px', textAlign: 'right', color: '#333', fontWeight: 'normal' }}>
                      {statusFormItem?.descripts || '单据状态'}：
                    </div>
                    <div className="flex-wrap" style={{ width: `calc(100% - ${statusWidth + 'px'})` }}>
                      <Radio.Group value={statusRadioVal} onChange={this.handleStatusRadioChange}>
                        {statusRadioData && statusRadioData.map((item, index) => {
                          return (
                            <Radio key={index} value={item.id}>{item.descripts + (item && 'count' in item ? '(' + item.count + ')' : '')}</Radio>
                          )
                        })}
                      </Radio.Group>
                    </div>
                  </div>
                ) : ''}
              </div>
              <PubilcTablePagination
                param={{
                  page,
                  total,
                  loading,
                  componentName: categoryData?.componentName || undefined,
                  pageSize: '20',
                  data: tableData, // 表格数据
                  x: totalWidth, // 表格的宽度
                  y: store.getState().tableHeight.y + 93 - queryHeight,
                  height: store.getState().tableHeight.y + 143 - queryHeight + 'px',
                  columns: columns && columns.length > 0 && categoryData?.deleteCode !== 'none' ? [...columns, operationObj] : columns, // 表头配置
                }}
                compilePage={this.compilePage}
                getColumns={this.getTableColumns}
                onClickRowPublic={this.onClickRowPublic}
                setRowClassNamePublic={this.setRowClassNamePublic}
              />
            </Card>
          ) : (
            <Card
              bordered={false}
              style={{ width: '48px', cursor: 'pointer', height: '100%' }}
              className="cvp-hide-modal"
              onClick={this.handleChangeLeftCardFlag}
              title={(
                <Tooltip title={'展开' + mainCardTitle}>
                  <Icon
                    type="double-right"
                    className="cvp-card-hide-icon cvp-card-show-icon"
                    onClick={this.handleChangeLeftCardFlag}
                  />
                </Tooltip>
              )}>
              <span>展开{mainCardTitle}</span>
            </Card>
          )}
          <div className="common-query-split-line" style={{ width: 8, height: '100%' }}></div>
          <div
            className="common-voucher-preparation-right-card"
            style={{ width: !leftCardFlag ? 'calc(100% - 628px)' : 'calc(100% - 56px)' }}
          >
            <Card
              size="small"
              bordered={false}
              title={(
                <div className="card-title-left-img">
                  <img src={iconMessages} alt="" />
                  正在{rowID ? '编辑' : '添加'}{categoryData?.cardTitle || '明细'}
                </div>
              )}
              extra={(
                <>
                  {categoryData.printCode && categoryData?.printBtnTopDisplay === 'Y' ? ( // 打印单据
                    <Button
                      size="small"
                      type="primary"
                      disabled={!rowID}
                      loading={printBtnLoading}
                      style={{ marginLeft: '12px' }}
                      onClick={this.handlePrint}
                    >
                      {categoryData?.printBtnTitle || '打印单据'}
                    </Button>
                  ) : ''}
                  {categoryData?.detailExportCode && categoryData?.detailExportBtnTopDisplay === 'Y' ? ( // 明细按钮导出
                    <Button
                      size="small"
                      type="primary"
                      disabled={!rowID}
                      loading={detailExportBtnLoading}
                      style={{ marginLeft: '12px' }}
                      onClick={() => this.handleDetailExport('detailExportBtnLoading', categoryData?.detailExportCode || '', 'ReactExportERPFlag')}
                    >
                      {categoryData?.detailExportBtnTitle || '导出'}
                    </Button>
                  ) : ''}
                  {categoryData?.detailExportGSPCode && categoryData?.detailExportBtnTopDisplay === 'Y' ? ( // 明细按钮导出
                    <Button
                      size="small"
                      type="primary"
                      disabled={!rowID}
                      loading={detailExportGSPBtnLoading}
                      style={{ marginLeft: '12px' }}
                      onClick={() => this.handleDetailExport('detailExportGSPBtnLoading', categoryData?.detailExportGSPCode || '', 'reactExportGSPFlag')}
                    >
                      {categoryData?.detailExportGSPBtnTitle || '导出GSP明细'}
                    </Button>
                  ) : ''}
                  {categoryData?.addBtnFlag === 'Y' ? (
                    <Button
                      icon="plus"
                      size="small"
                      style={{ marginLeft: '12px' }}
                      className="add-btn add-btn-nohover"
                      onClick={this.handleClearSelectData}
                    >
                      {('addBtnTitle' in categoryData && categoryData.addBtnTitle) ? categoryData?.addBtnTitle : ('添加' + (categoryData?.cardTitle || '单据'))}
                    </Button>
                  ) : ''}
                </>
              )}
            >
              <div className="common-voucher-preparation-right-card-content scroll-bar-style" style={{ height: store.getState().tableHeight.y + 181 + 'px' }}>
                {categoryData && categoryData?.stepsFlag === 'Y' ? (
                  <div style={{ width: '100%', padding: stepsWidth > 1000 ? '24px' : '24px 100px', paddingBottom: '12px', overflowX: 'auto', marginBottom: '12px' }}>
                    <div style={{ width: stepsWidth > 1000 ? (stepsWidth + 'px') : '100%' }}>
                      <Steps current={currentStep}>
                        {stepsData && stepsData.map((item, index) => (
                          <Step
                            key={index}
                            status={item.statusType === 'N' ? 'error' : ''}
                            title={item.title}
                            description={
                              <>
                                <Tooltip title={item.content}>
                                  <div className='ellipsis' style={{ width: '100%' }}>{item.content}</div>
                                </Tooltip>
                                {item.remark ? (
                                  <Tooltip title={item.remark}>
                                    <div className='ellipsis' style={{ width: '100%' }}>{item.remark}</div>
                                  </Tooltip>
                                ) : ''}
                              </>
                            } />
                        ))}
                      </Steps>
                    </div>
                  </div>
                ) : ''}
                <Card
                  type="inner"
                  size="small"
                  title="基本信息"
                  style={{ marginBottom: '12px' }}
                  extra={(
                    categoryData?.entrySequenceBtnFlag === 'Y' ? (
                      <Button
                        size="small"
                        onClick={() => this.handleEntrySequence(detailComponentName)}
                      >
                        录入顺序
                      </Button>
                    ) : ''
                  )}
                >
                  <DynamicRenderingForm
                    isEnterJump='Y'
                    rowData={rowData}
                    formData={baseFormData}
                    selectData={selectData}
                    onRef={ref => this.baseFormRef = ref}
                    handleQueryFormData={this.getTableColumns}
                  />
                </Card>
                <Card
                  type="inner"
                  size="small"
                  title={categoryData?.detailCardTitle || '明细'}
                  style={{ minHeight: store.getState().tableHeight.y - 180 + 'px' }}
                  extra={(
                    <div className="flex">
                      {categoryData?.detailInlineEditingAuxiliaryFlag === 'Y' && categoryData?.scanningInputFlag === 'Y' ? (
                        <Input
                          ref={this.scanningRef}
                          placeholder={categoryData?.scanningPlaceholder || '请输入产品编号回车检索'}
                          value={scanningCode}
                          style={{ width: '350px', marginRight: '12px' }}
                          disabled={categoryData && categoryData.groupType === 'G' ? true : !detailDeleteFlag}
                          onChange={Util.commonInputChange.bind(this, 'scanningCode')}
                          onPressEnter={this.handleScanningCodePressEnter}
                        />
                      ) : ''}
                      {categoryData?.detailInlineEditingAuxiliaryFlag === 'Y' ? (
                        categoryData?.auxiliaryMenuBtnDataIndex && auxiliaryMenuData && auxiliaryMenuData.length > 0 ? ( // 辅助制单多按钮标识字段
                          <Dropdown overlay={auxiliaryMenu}>
                            <Button
                              size={categoryData?.scanningInputFlag === 'Y' ? 'default' : 'small'}
                              disabled={detailBtnDisabledFlag}
                            >
                              {categoryData?.auxiliaryBtnTitle || '辅助录单'} <Icon type="down" />
                            </Button>
                          </Dropdown>
                        ) : (
                          <Button
                            size={categoryData?.scanningInputFlag === 'Y' ? 'default' : 'small'}
                            onClick={this.handleSelectOrder}
                            // 集团采购审核 -> A; 集团采购计划 -> V; 集团退货单确认 -> J
                            disabled={detailBtnDisabledFlag}
                          >
                            {categoryData?.auxiliaryBtnTitle || '辅助录单'}
                          </Button>
                        )) : ''}
                      {categoryData?.detailInlineEditingAuxiliaryFlag === 'Y' && categoryData?.detailImportExcelBtnFlag === 'Y' ? (
                        <Upload  {...detailUploadExcelParams}>
                          <Button
                            size={categoryData?.scanningInputFlag === 'Y' ? 'default' : 'small'}
                            style={{ marginLeft: '12px' }}
                            disabled={detailBtnDisabledFlag}
                          >
                            {categoryData?.detailImportExcelBtnTitle || '导入'}
                          </Button>
                        </Upload>
                      ) : ''}
                    </div>
                  )}
                >
                  <div className="flex-between-center" style={{ marginBottom: '12px' }}>
                    <div className="flex-align-items">
                      {categoryData?.detailInlineEditingFlag === 'Y' ? ( // 明细行内编辑标志
                        <>
                          {categoryData?.detailInlineEditingAddBtnFlag == 'Y' ? (
                            <span
                              className={detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                              onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('addTableData', 'click')}
                            >
                              <Icon className="doctor-add-splice" style={{ marginLeft: 0 }} />
                              {categoryData?.detailInlineEditingAddText || '新增'}
                            </span>
                          ) : ''}
                          {categoryData?.detailInlineEditingCopyBtnFlag == 'Y' ? (
                            <>
                              {categoryData?.detailInlineEditingAddBtnFlag === 'N' ? '' : <Divider type="vertical" />}
                              <span
                                className={detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                                onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('handleCopy', 'click')}
                              >
                                <Icon className="doctor-copy-splice" style={{ marginLeft: 0 }} />
                                {categoryData?.detailInlineEditingCopyText || '复制'}
                              </span>
                            </>
                          ) : ''}
                          {categoryData?.detailInlineEditingModifyBtnFlag === 'Y' ? (
                            <>
                              {categoryData?.detailInlineEditingAddBtnFlag === 'N' && categoryData?.detailInlineEditingCopyBtnFlag === 'N' ? '' : <Divider type="vertical" />}
                              <span
                                className={!(detailSelectedRowKeys && detailSelectedRowKeys.length > 0) || detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                                onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('handleMultilineModify')}
                              >
                                <Icon className="doctor-menu-unfold-splice" />
                                {categoryData?.detailInlineEditingModifyText || '编辑'}
                              </span>
                            </>
                          ) : ''}
                          {categoryData?.detailInlineEditingMoveBtnFlag === 'Y' ? (
                            <>
                              {categoryData?.detailInlineEditingAddBtnFlag === 'N' && categoryData?.detailInlineEditingCopyBtnFlag === 'N' && categoryData?.detailInlineEditingModifyBtnFlag === 'N' ? '' : <Divider type="vertical" />}
                              <span
                                className={!(detailSelectedRowKeys && detailSelectedRowKeys.length > 0) || detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                                onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('handleUp')}
                              >
                                <Icon className="doctor-up-splice" />
                                {categoryData?.detailInlineEditingMoveUpText || '上移'}
                              </span>
                              <Divider type="vertical" />
                              <span
                                className={!(detailSelectedRowKeys && detailSelectedRowKeys.length > 0) || detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                                onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('handleDown')}
                              >
                                <Icon className="doctor-down-splice" />
                                {categoryData?.detailInlineEditingMoveDownText || '下移'}
                              </span>
                            </>
                          ) : ''}
                          {categoryData?.detailInlineEditingDeleteBtnFlag === 'Y' ? (
                            <>
                              {categoryData?.detailInlineEditingAddBtnFlag === 'N' && categoryData?.detailInlineEditingCopyBtnFlag === 'N' && categoryData?.detailInlineEditingModifyBtnFlag === 'N' && categoryData?.detailInlineEditingMoveBtnFlag === 'N' ? '' : <Divider type="vertical" />}
                              <span
                                className={!(detailSelectedRowKeys && detailSelectedRowKeys.length > 0) || detailBtnDisabledFlag ? 'common-color999' : 'common-color333'}
                                onClick={detailBtnDisabledFlag ? null : () => this.handleInlineEditingMethodCall('handleMultilineDelete')}
                              >
                                <Icon className="doctor-delete-splice" />
                                {categoryData?.detailInlineEditingDeleteText || '删除'}
                              </span>
                            </>
                          ) : ''}
                        </>
                      ) : (
                        <>
                          {categoryData?.scanningInputFlag === 'Y' ? (
                            <Input
                              ref={this.scanningRef}
                              placeholder={categoryData?.scanningPlaceholder || '请输入产品编号回车检索'}
                              value={scanningCode}
                              style={{ width: '350px', marginRight: '12px' }}
                              disabled={categoryData && categoryData.groupType === 'G' ? true : !detailDeleteFlag}
                              onChange={Util.commonInputChange.bind(this, 'scanningCode')}
                              onPressEnter={this.handleScanningCodePressEnter}
                            />
                          ) : ''}
                          {categoryData?.hideAuxiliaryBtn !== 'Y' ? ( // 是否展示辅助制单按钮
                            auxiliaryMenuData && auxiliaryMenuData.length > 0 ? ( // 辅助制单多按钮标识字段
                              <Dropdown overlay={auxiliaryMenu}>
                                <Button
                                  ghost
                                  type="primary"
                                  disabled={detailBtnDisabledFlag}
                                >
                                  {categoryData?.auxiliaryBtnTitle || '辅助录单'}
                                </Button>
                              </Dropdown>
                            ) : (
                              <Button
                                ghost
                                type="primary"
                                onClick={this.handleSelectOrder}
                                // 集团采购审核 -> A; 集团采购计划 -> V; 集团退货单确认 -> J
                                disabled={detailBtnDisabledFlag}
                              >
                                {categoryData?.auxiliaryBtnTitle || '辅助录单'}
                              </Button>
                            )
                          ) : ''}
                          {categoryData?.detailImportExcelBtnFlag === 'Y' ? (
                            <Upload  {...detailUploadExcelParams}>
                              <Button
                                ghost
                                type="primary"
                                style={{ marginLeft: '12px' }}
                                disabled={detailBtnDisabledFlag}
                              >
                                {categoryData?.detailImportExcelBtnTitle || '导入'}
                              </Button>
                            </Upload>
                          ) : ''}
                        </>
                      )}
                    </div>
                    <div className="common-voucher-preparation-statistics">
                      共计：<span className="common-voucher-preparation-statistics-span">{detailTableData?.length || 0}</span>条记录
                      {categoryData.totalAmountFlag === 'Y' ? <>
                        <span style={{ marginLeft: 12 }}>{categoryData?.rpSumDesc || '进价总金额'}：</span>
                        <span className="common-voucher-preparation-statistics-span">{sumRp || 0}</span>
                        <span style={{ marginLeft: 12 }}>{categoryData?.spSumDesc || '售价总金额'}：</span>
                        <span className="common-voucher-preparation-statistics-span">{sumSp || 0}</span>
                      </> : ''}
                    </div>
                  </div>
                  {categoryData?.detailInlineEditingFlag === 'Y' ? (
                    <>
                      <PublicTableinLineEditing
                        admID="empty"
                        tooltipFlag="N"
                        modalTableSelectBy="record" // 弹窗确认选择值方式
                        componentName={detailComponentName}
                        inputTableIncomingDepartmentFlag={categoryData?.inputTableIncomingDepartmentFlag || 'N'} // inputTable是否传入基本信息科室树
                        verifyEmptyDataFlag={categoryData?.detailInlineAddVerifyEmptyDataFlag || 'Y'}
                        operationFlag={categoryData?.detailInlineOperationFlag || 'N'}
                        operationFixed={categoryData?.detailInlineoperationFixedFlag === 'Y' ? 'right' : ''}
                        recordID={categoryData?.detailIDIndex || 'id'}
                        deleteCode={categoryData?.detailDeleteCode || categoryData?.deleteCode || ''}
                        onRef={ref => this.lineEditableRef = ref}
                        rowSelectionDisabledFlag={detailBtnDisabledFlag}
                        getFrLocID={this.getFrLocID}
                        rowSelectionPublic={this.handleDetailInlineRowSelection}
                        getColumns={this.getDetailColumns}
                        updateTableData={this.updateDetailTableData}
                        totalAmountCalculation={this.totalAmountCalculation}
                      />
                    </>
                  ) : (
                    <PubilcTablePagination
                      param={{
                        componentName: detailComponentName,
                        data: detailTableData, // 表格数据
                        x: detailTotalWidth, // 表格的宽度
                        y: 'N',
                        height: 'auto',
                        loading: detailLoading,
                        columns: categoryData && categoryData.groupType !== 'G' && categoryData?.detailDeleteCode !== 'none' ? [...detailColumns, detailOperationObj] : detailColumns, // 表头配置
                      }}
                      getColumns={this.getDetailColumns}
                      onClickRowPublic={this.handleDetailRowClick}
                      setRowClassNamePublic={this.handleDetailRowClassName}
                    />
                  )}
                </Card>
                <div className="common-voucher-preparation-right-footer flex-center-align-end">
                  {categoryData?.operationType === 'audit' || categoryData?.groupType === 'G' || ( // 审核界面
                    categoryData?.groupType === 'A' && (categoryData.componentName === 'IMGroupProcurementPlan' || categoryData.componentName === 'IMGroupPurchasePlanReview')) ? ( // 集团采购中心(IMProcurementPlan) / 科室退库申请接收(IMStockReturnApply)
                    <>
                      {/* categoryData?.revokeCode !== 'none' */}
                      {categoryData?.saveCode !== 'none' ? ( // 等于none的时候不展示
                        rowData && rowData.statusCode === (categoryData?.beforeReturningStatusCode || '20') ? (
                          <Popconfirm
                            title={(categoryData?.saveBtnTitle || '退回') + '后不可恢复，确定要' + (categoryData?.saveBtnTitle || '退回') + '吗?'}
                            // 科室退库申请接收拒绝(IMStockReturnApply - 走弹窗退回但是不走保存方法) / 以及采购计划(IMProcurementPlan) / 采购计划审核(IMPurchasePlanReview)走保存拒绝
                            onConfirm={categoryData?.returnMethod ? (
                              () => this.handleReturnOrder(categoryData?.afterReturnStatusCode || '40', categoryData?.returnMethod || 'orderReturn')
                            ) : (
                              () => this.handleModifyOrderStatus(categoryData?.afterReturnStatusCode || '40')
                            )}
                          >
                            <Button
                              ghost
                              type="danger"
                            >
                              {categoryData?.saveBtnTitle || '退回'}
                            </Button>
                          </Popconfirm>
                        ) : (
                          <Button
                            ghost
                            disabled
                            type="danger"
                            style={{ display: rowData.statusCode === '30' ? 'none' : 'inline-block' }}
                          >
                            {categoryData?.saveBtnTitle || '退回'}
                          </Button>
                        )) : ''}
                      {categoryData?.auditCode !== 'N' && categoryData?.auditCode !== 'none' ? (
                        <Button
                          ghost
                          type="primary"
                          style={{ marginLeft: '12px', display: rowData.statusCode === '30' ? 'none' : 'inline-block' }}
                          // 审核接口维护了则走审核接口，没维护则改状态为30
                          onClick={categoryData && 'auditCode' in categoryData && categoryData.auditCode ? this.handleAudit : () => this.handleModifyOrderStatus(categoryData?.postAuditStatusCode || '30')}
                          // 集团退货审核状态为60，集团退货单确认状态为70（40 医院采购审核   50 集团采购审核   60 集团采购制单 70 集团采购制单审核  30 接收）
                          // preAuditStatusCode为审核前状态，默认为20
                          disabled={(categoryData?.componentName === 'IMReturnVoucher') ? rowData.statusCode !== '70' : (
                            rowData.statusCode !== (categoryData?.preAuditStatusCode || '20')
                          )}
                        >
                          {categoryData?.auditBtnTitle || '审核通过'}
                        </Button>
                      ) : ''}
                      {categoryData?.revokeCode === 'N' || categoryData?.revokeCode === 'none' ? '' : (  // 科室退库申请接收和退货申请接收不支持撤销
                        rowData.statusCode === (categoryData?.postAuditStatusCode || '30') ? (
                          <Popconfirm
                            title={(categoryData?.revokeBtnTitle || '撤销审核') + '后不可恢复，确定要' + (categoryData?.revokeBtnTitle || '撤销审核') + '吗?'}
                            onConfirm={categoryData && 'revokeCode' in categoryData && categoryData.revokeCode ? this.handleRevoke : () => this.handleModifyOrderStatus(categoryData?.preAuditStatusCode || '20')}
                          >
                            <Button type="danger">
                              {categoryData?.revokeBtnTitle || '撤销审核'}
                            </Button>
                          </Popconfirm>
                        ) : (
                          <Button
                            disabled
                            type="danger"
                            // 当审核按钮不存在只有一个撤销按钮时 - 按钮始终展示
                            style={{ display: categoryData?.auditCode === 'N' || categoryData?.auditCode === 'none' || rowData.statusCode === (categoryData?.postAuditStatusCode || '30') ? 'inline-block' : 'none' }}
                          >
                            {categoryData?.revokeBtnTitle || '撤销审核'}
                          </Button>
                        )
                      )}
                    </>
                  ) : ( // 提交界面
                    <>
                      <Button
                        ghost
                        type="primary"
                        loading={saveBtnLoading}
                        disabled={rowID ? ((rowData.statusCode === '10') ? false : true) : false}
                        onClick={() => this.handleSave(categoryData?.preAuditStatusCode || '10')}
                      >
                        {rowID ? '确认修改' : '暂存'}
                      </Button>
                      <Button
                        type="primary"
                        loading={auditBtnLoading}
                        style={{ display: !rowID || (rowData.statusCode === (categoryData?.preAuditStatusCode || '10') || rowData.statusCode === '40') ? 'inline-block' : 'none', marginLeft: '12px' }}
                        onClick={() => this.handleSave(categoryData?.postAuditStatusCode || '20')}
                      >
                        {rowData.statusCode === '40' ? '重新提交' : (categoryData?.auditBtnTitle || '提交审核')}
                      </Button>
                      {categoryData && 'revokeCode' in categoryData && categoryData.revokeCode ? ( // 审核接口
                        <Popconfirm
                          title="撤回后不可恢复，确定要撤回吗?"
                          onConfirm={() => this.handleModifyOrderStatus(categoryData?.afterReturnStatusCode || '10')}
                        >
                          <Button
                            ghost
                            type="danger"
                            style={{ display: rowData.statusCode === (categoryData?.beforeReturningStatusCode || '20') ? 'inline-block' : 'none', marginLeft: '12px' }}
                          >
                            {categoryData?.revokeBtnTitle || '撤回单据'}
                          </Button>
                        </Popconfirm>
                      ) : ''}
                    </>
                  )}
                  {categoryData.printCode && categoryData?.printBtnTopDisplay !== 'Y' ? ( // 打印单据
                    <>
                      <Button
                        type="primary"
                        loading={printBtnLoading}
                        style={{ display: rowID ? 'inline-block' : 'none', marginLeft: '12px' }}
                        onClick={this.handlePrint}
                      >
                        {categoryData?.printBtnTitle || '打印单据'}
                      </Button>
                    </>
                  ) : ''}
                  {categoryData?.detailExportCode && categoryData?.detailExportBtnTopDisplay !== 'Y' ? ( // 明细按钮导出
                    <Button
                      type="primary"
                      loading={detailExportBtnLoading}
                      style={{ display: rowID ? 'inline-block' : 'none', marginLeft: '12px' }}
                      onClick={() => this.handleDetailExport('detailExportBtnLoading', categoryData?.detailExportCode || '', 'ReactExportERPFlag')}
                    >
                      {categoryData?.detailExportBtnTitle || '导出'}
                    </Button>
                  ) : ''}
                  {categoryData?.detailExportGSPCode && categoryData?.detailExportBtnTopDisplay !== 'Y' ? ( // 明细导出GSP
                    <Button
                      type="primary"
                      loading={detailExportGSPBtnLoading}
                      style={{ display: rowID ? 'inline-block' : 'none', marginLeft: '12px' }}
                      onClick={() => this.handleDetailExport('detailExportGSPBtnLoading', categoryData?.detailExportGSPCode || '', 'reactExportGSPFlag')}
                    >
                      {categoryData?.detailExportGSPBtnTitle || '导出GSP明细'}
                    </Button>
                  ) : ''}
                </div>
              </div>
            </Card>
          </div>
        </div >

        {/* 退回订单 */}
        <ReturnOrder selectData={selectData} modifyApplicationFormStatus={this.modifyApplicationFormStatus} onRef={ref => this.returnOrderRef = ref} />

        {/* 查看详情 */}
        <MatchingDetails interfaceFlag="InventoryManagement" handleReturnOrder={this.handleDetailsReturnOrder} modifyApplicationFormStatus={this.modifyApplicationFormStatus} onRef={ref => this.matchingDetailsRef = ref} />

        {/* 从订单选择 */}
        <OrderOfGlassesModal
          frLocID={frLocID}
          vendorID={vendorID}
          defaultDate={defaultDate}
          getTableData={this.getDetailTableData}
          auxiliaryLocIDIndex={categoryData?.auxiliaryLocIDIndex || 'frLocID'}
          orderModalType={orderModalType}
          modalTitle={assistModalTitle}
          tableCode={categoryData?.auxiliaryModalCode || ''}
          orderDateTitle={categoryData?.assistModalDateTitle || '订单日期'}
          hidePatInfo={categoryData?.hideAssistModalPatientInfo || 'N'} // 是否隐藏人员搜索相关输入信息
          hidePresExchangeFlag={categoryData?.hideAssistModalPresExchangeFlag || 'N'} // 是否隐藏处方交换标识
          hideViewDetails={categoryData?.hideViewDetails || 'N'} // 是否隐藏列操作查看详情
          hideBrandFlag={categoryData?.hideAssistModalBrandFlag || 'N'} // 是否隐藏列操作查看详情
          okText={categoryData?.assistModalOkText || '确定'} // 确认按钮描述
          cancelText={categoryData?.assistModalCancelText || '取消'} // 取消按钮描述
          orderStatusText={categoryData?.assistModalOrderStatusText || '订单状态'} // 是否隐藏列操作查看详情
          idIndex={categoryData?.assistModalIDIndex || 'glassesRequestID'} // 赋值制单列表行id字段
          modifyStatusIDIndex={categoryData?.assistModalModifyStatusIDIndex || 'requestIDArr'} // 修改申请单状态后台接收的字段
          modifyStatusCode={categoryData?.assistModaModifyStatusCode || '17030026'} // 修改申请单状态【栗子：采购计划直接退回申请】
          returnOrderCode={categoryData?.assistModalReturnOrderCode || ''} // 退回按钮传入接口状态代码【10为供应商退回，25为采购计划医院退回】
          interfaceFlag={categoryData?.componentName || ''}
          selectData={selectData}
          addDetailData={this.handleAddDetailData}
          onRef={ref => this.orderOfGlassesRef = ref}
        />
      </Spin>
    )
  }
};

export default InventoryManagement;

/*
 * 菜单参数配置
 * 采购计划: params=interfaceType:warehouseVP&selectCode:17060033&cardTitle:采购计划&detailCardTitle:采购明细&componentName:IMProcurementPlan&queryCode:17060035&queryDetailCode:17060036&idIndex:optPurPlanID&detailIDIndex:optPurPlanDetailID&deleteCode:17060038&saveCode:17060037&revokeCode:17060039&auxiliaryModalCode:17060034&groupType:H&auditBtnTitle:完成&revokeBtnTitle:撤销完成&auxiliaryBtnTitle:选择订单&orderModalType:purPlan&auxiliaryLocIDIndex:locID&returnMethod:orderReturn&mainListExportCode:17060115&stateSpreadingIndex:statusCode&stepsFlag:Y&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 采购收货：params=interfaceType:warehouseVP&selectCode:17060040&cardTitle:采购收货&detailCardTitle:收货明细&componentName:IMPurchaseReceipt&queryCode:17060041&queryDetailCode:17060042&idIndex:purReceiptID&detailIDIndex:purReceiptDetailID&deleteCode:17060044&saveCode:17060043&revokeCode:17060045&auditBtnTitle:完成&revokeBtnTitle:撤销完成&scanningPlaceholder:扫码收货&orderModalType:PurReceipt&auxiliaryLocIDIndex:locID&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:Y&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 医院采购计划审核: params=interfaceType:warehouseVP&selectCode:17060033&cardTitle:采购计划&detailCardTitle:采购明细&componentName:IMPurchasePlanReview&queryCode:17060035&queryDetailCode:17060036&idIndex:optPurPlanID&detailIDIndex:optPurPlanDetailID&deleteCode:none&detailDeleteCode:none&saveCode:17060037&revokeCode:17060039&auxiliaryModalCode:17060034&groupType:G&revokeBtnTitle:撤销审核&auxiliaryBtnTitle:选择订单&orderModalType:purPlan&auxiliaryLocIDIndex:locID&stepsFlag:Y&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:N&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&interfaceTypeDesc:采购制单样式
 * 质量检查: params=interfaceType:warehouseVP&selectCode:17060046&cardTitle:质检单&detailCardTitle:质检单明细&componentName:IMWarehousingInspect&queryCode:17060047&queryDetailCode:17060048&idIndex:qualityInspectID&detailIDIndex:qualityInspectDetailID&deleteCode:17060050&saveCode:17060049&revokeCode:17060051&groupType:H&auditBtnTitle:完成&revokeBtnTitle:撤销完成&orderModalType:InQuality&auxiliaryLocIDIndex:locID&stateSpreadingIndex:statusCode&spSumDesc:医院售价总金额(含税)&rpSumDesc:医院进价总金额(含税)&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:Y&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 入库复核：params=interfaceType:warehouseVP&selectCode:17060059&cardTitle:入库单&detailCardTitle:入库明细&componentName:IMWarehousingReview&queryCode:17060060&queryDetailCode:17060061&idIndex:inReviewID&deleteCode:17060063&saveCode:17060062&auditBtnTitle:审核入库&auxiliaryBtnTitle:辅助入库&orderModalType:InReview&auxiliaryLocIDIndex:locID&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&interfaceTypeDesc:采购制单样式
 * 采购收货: params=interfaceType:warehouseVP&selectCode:17060040&cardTitle:采购收货&detailCardTitle:收货明细&componentName:IMPurchaseReceipt&queryCode:17060041&queryDetailCode:17060042&idIndex:purReceiptID&detailIDIndex:purReceiptDetailID&deleteCode:17060044&saveCode:17060043&revokeCode:17060045&auditBtnTitle:完成&revokeBtnTitle:撤销完成&scanningPlaceholder:扫码收货&orderModalType:PurReceipt&auxiliaryLocIDIndex:locID&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:Y&interfaceTypeDesc:采购制单样式
 * 科室退库申请: params=interfaceType:warehouseVP&selectCode:17060052&cardTitle:退库单&detailCardTitle:退库明细&componentName:IMStockReturnApply&queryCode:17060053&queryDetailCode:17060054&idIndex:returnStockID&detailIDIndex:returnStockDetailID&deleteCode:17060056&saveCode:17060055&revokeCode:17060057&groupType:H&auditBtnTitle:发送&revokeBtnTitle:撤销发送&auxiliaryBtnTitle:辅助退库&orderModalType:ReturnStock&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 科室退库申请接收: params=interfaceType:warehouseVP&selectCode:17060052&cardTitle:退库单&detailCardTitle:退库明细&componentName:IMStockReturnApply&queryCode:17060053&queryDetailCode:17060054&idIndex:returnStockID&detailIDIndex:returnStockDetailID&deleteCode:none&detailDeleteCode:none&saveCode:17060057&revokeCode:17060074&groupType:G&saveBtnTitle:拒绝&auditBtnTitle:接收&auditCode:17060058&revokeBtnTitle:撤销接收&auxiliaryBtnTitle:辅助退库&orderModalType:ReturnStock&returnMethod:orderReturn&stateSpreadingIndex:statusCode&spSumDesc:医院售价总金额（含税）&rpSumDesc:医院进价总金额（含税）&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 退货申请：params=interfaceType:warehouseVP&selectCode:17060064&cardTitle:退货申请&detailCardTitle:退货明细&componentName:IMReturnVoucher&queryCode:17060065&queryDetailCode:17060066&idIndex:returnHandleID&detailIDIndex:returnHandleDetailID&deleteCode:17060068&saveCode:17060067&revokeCode:none&groupType:H&auditBtnTitle:发送&auxiliaryBtnTitle:辅助退货&orderModalType:ReturnHandle&auxiliaryLocIDIndex:locID&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 退货单处理：params=interfaceType:warehouseVP&selectCode:17060064&cardTitle:退货申请&detailCardTitle:退货明细&componentName:IMReturnOrderProcessing&queryCode:17060065&queryDetailCode:17060066&idIndex:returnHandleID&detailIDIndex:returnHandleDetailID&deleteCode:17060068&saveCode:none&revokeCode:none&groupType:G&auditBtnTitle:接收&auditCode:17060069&revokeBtnTitle:撤销接收&auxiliaryBtnTitle:辅助退货&orderModalType:ReturnHandle&auxiliaryLocIDIndex:locID&preAuditStatusCode:80&postAuditStatusCode:90&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:N&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团采购确认: params=interfaceType:warehouseVP&selectCode:17060076&cardTitle:采购计划&detailCardTitle:采购明细&componentName:IMGroupProcurementPlan&queryCode:17060077&queryDetailCode:17060078&idIndex:optGroupPurPlanID&detailIDIndex:optGroupPurPlanDetailID&deleteCode:none&detailDeleteCode:none&saveCode:none&revokeCode:17060081&auxiliaryModalCode:17060034&groupType:A&auditBtnTitle:审核&revokeBtnTitle:撤销审核&auxiliaryBtnTitle:选择订单&orderModalType:groupPurPlan&auxiliaryLocIDIndex:locID&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&interfaceTypeDesc:采购制单样式
 * 集团采购计划: params=interfaceType:warehouseVP&selectCode:17060076&cardTitle:采购计划&detailCardTitle:采购明细&componentName:IMGroupProcurementPlan&queryCode:17060077&queryDetailCode:17060078&idIndex:optGroupPurPlanID&detailIDIndex:optGroupPurPlanDetailID&deleteCode:17060080&saveCode:17060079&revokeCode:17060081&auxiliaryModalCode:17060034&groupType:V&saveBtnTitle:保存&auditBtnTitle:发送&auxiliaryBtnTitle:选择订单&orderModalType:groupPurPlan&auxiliaryLocIDIndex:locID&assistComponentName:GroupOrderOfGlassesModal&stateSpreadingIndex:statusCode&spSumDesc:集团销售总金额（含税）&rpSumDesc:集团采购总金额（含税）&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团采购审核：params=interfaceType:warehouseVP&selectCode:17060076&cardTitle:采购计划&detailCardTitle:采购明细&componentName:IMGroupPurchasePlanReview&queryCode:17060077&queryDetailCode:17060078&idIndex:optGroupPurPlanID&detailIDIndex:optGroupPurPlanDetailID&deleteCode:none&detailDeleteCode:none&saveCode:none&revokeCode:17060081&auxiliaryModalCode:17060034&groupType:A&operationType:audit&auditBtnTitle:审核&revokeBtnTitle:撤销审核&auxiliaryBtnTitle:选择订单&orderModalType:groupPurPlan&auxiliaryLocIDIndex:locID&assistComponentName:GroupOrderOfGlassesModal&stateSpreadingIndex:statusCode&spSumDesc:集团销售总金额(含税)&rpSumDesc:集团采购总金额(含税)&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团退货制单审核: params=interfaceType:warehouseVP&selectCode:17060064&cardTitle:退货申请&detailCardTitle:退货明细&componentName:IMGroupReturnOrderApproval&queryCode:17060065&queryDetailCode:17060066&idIndex:returnHandleID&detailIDIndex:returnHandleDetailID&deleteCode:none&detailDeleteCode:none&saveCode:none&revokeCode:none&groupType:JA&operationType:audit&auditBtnTitle:审核&auditCode:17060069&revokeBtnTitle:撤销审核&auxiliaryLocIDIndex:locID&preAuditStatusCode:60&postAuditStatusCode:70&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:N&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团退货制单：params=interfaceType:warehouseVP&selectCode:17060064&cardTitle:退货单&detailCardTitle:退货明细&componentName:IMGroupReturnOrderConfirmation&queryCode:17060065&queryDetailCode:17060066&idIndex:returnHandleID&detailIDIndex:returnHandleDetailID&deleteCode:17060068&saveCode:17060083&revokeCode:17060133&groupType:J&auditBtnTitle:发送&revokeBtnTitle:撤销发送&orderModalType:GroupReturnHandle&auxiliaryLocIDIndex:locID&assistComponentName:GroupOrderOfGlassesModal&preAuditStatusCode:55&postAuditStatusCode:60&beforeReturningStatusCode:60&afterReturnStatusCode:55&stateSpreadingIndex:statusCode&stepsFlag:N&scanningInputFlag:N&detailRowClickFlag:N&totalAmountFlag:N&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团入库制单：params=interfaceType:warehouseVP&selectCode:17060119&cardTitle:入库制单&detailCardTitle:入库明细&componentName:NVPReceiptGroupVP&queryCode:17060120&queryDetailCode:17060121&idIndex:groupStkRecID&detailIDIndex:groupStkRecDetailID&deleteCode:17060123&saveCode:17060122&revokeCode:17060125&orderModalType:GroupInOperate&assistComponentName:GroupOrderOfGlassesModal&spSumDesc:集团销售总金额(含税)&rpSumDesc:集团采购总金额(含税)&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:N&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团质量检查：params=interfaceType:warehouseVP&selectCode:17060046&cardTitle:质检单&detailCardTitle:质检单明细&componentName:IMGroupWarehousingInspect&queryCode:17060047&queryDetailCode:17060048&idIndex:qualityInspectID&detailIDIndex:qualityInspectDetailID&deleteCode:17060050&saveCode:17060049&revokeCode:17060051&groupType:J&auditBtnTitle:完成&revokeBtnTitle:撤销完成&orderModalType:GroupInQuality&auxiliaryLocIDIndex:locID&assistComponentName:GroupOrderOfGlassesModal&stateSpreadingIndex:statusCode&spSumDesc:集团销售总金额(含税)&rpSumDesc:集团采购总金额(含税)&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:Y&detailReasonModifyFlag:Y&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团出库制单：params=interfaceType:warehouseVP&selectCode:17060126&cardTitle:出库单&detailCardTitle:出库单明细&componentName:NVPTransferGroupVP&queryCode:17060127&queryDetailCode:17060128&idIndex:groupOutboundID&detailIDIndex:groupOutboundDetailID&deleteCode:17060130&saveCode:17060129&revokeCode:17060132&auditBtnTitle:发送&scanningPlaceholder:扫码出库&orderModalType:GroupOutBound&auxiliaryLocIDIndex:locID&addBtnTitle:新增出库单&assistComponentName:GroupOrderOfGlassesModal&spSumDesc:集团销售总金额(含税)&rpSumDesc:集团采购总金额(含税)&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:N&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 集团采购收货：params=interfaceType:warehouseVP&selectCode:17060109&cardTitle:采购收货&detailCardTitle:收货明细&componentName:IMGroupPurchaseReceipt&queryCode:17060110&queryDetailCode:17060111&idIndex:groupPurReceiptID&detailIDIndex:groupPurReceiptDetailID&deleteCode:17060113&saveCode:17060112&revokeCode:17060114&auditBtnTitle:完成&revokeBtnTitle:撤销完成&scanningPlaceholder:扫码收货&orderModalType:GroupPurReceipt&auxiliaryLocIDIndex:locID&assistComponentName:GroupOrderOfGlassesModal&stateSpreadingIndex:statusCode&spSumDesc:集团销售总金额(含税)&rpSumDesc:集团采购总金额(含税)&stepsFlag:N&scanningInputFlag:Y&detailRowClickFlag:N&totalAmountFlag:Y&entrySequenceBtnFlag:Y&addBtnFlag:Y&printBtnFlag:N&operationFixedFlag:N&detailReasonModifyFlag:Y&stateSpreadingFlag:Y&interfaceTypeDesc:采购制单样式
 * 
 * */